Best Practices. 2 How to design a Software Solution The plans or designs: –Represent the agreed upon needs of the user (“contract”) –Communicate what.

Slides:



Advertisements
Similar presentations
Design Validation CSCI 5801: Software Engineering.
Advertisements

Software Engineering Key design concepts Design heuristics Design practices.
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
Ch 3 System Development Environment
Design Concepts and Principles
Case Tools Trisha Cummings. Our Definition of CASE  CASE is the use of computer-based support in the software development process.  A CASE tool is a.
A P RAGMATIC A PPROACH Brent Bradbury Joshua Bruning.
Software Architecture Design Instructor: Dr. Jerry Gao.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Chapter 1 Principles of Programming and Software Engineering.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 22 Object-Oriented Design
Course Instructor: Aisha Azeem
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Software Engineering Muhammad Fahad Khan
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Introduction to Object-oriented programming and software development Lecture 1.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
An Introduction to Software Architecture
CSE 303 – Software Design and Architecture
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
©Ian Sommerville 2000, Mejia-Alvarez 2009 Slide 1 Software Processes l Coherent sets of activities for specifying, designing, implementing and testing.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
SOFTWARE DESIGN.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
CSE 219 Computer Science III Program Design Principles.
SE: CHAPTER 7 Writing The Program
Systems Analysis and Design in a Changing World, 3rd Edition
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
GRASP: Designing Objects with Responsibilities
Slide 12.1 Chapter 12 Implementation. Slide 12.2 Learning outcomes Produce a plan to minimize the risks involved with the launch phase of an e-business.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
Structural Design Patterns
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
1 CMPT 275 High Level Design Phase Modularization.
The Software Development Process
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Chapter 6 CASE Tools Software Engineering Chapter 6-- CASE TOOLS
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Object-Oriented Principles Applications to Programming.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Evaluating Architectures. Quality Control Rarely fun, but always necessary 1.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
CSE 303 – Software Design and Architecture
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
CompSci 280 S Introduction to Software Development
System Design Ashima Wadhwa.
Software Quality Engineering
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
Analysis models and design models
An Introduction to Software Architecture
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Applying Use Cases (Chapters 25,26)
Presentation transcript:

Best Practices

2 How to design a Software Solution The plans or designs: –Represent the agreed upon needs of the user (“contract”) –Communicate what the programmers need to implement –Assist future programmers in maintaining or enhancing code

3 Design Tools Design methods –Describe how to design a solution (specify design practices and strategies) Design patterns –Offer generic solutions to a problem by describing a problem and a strategy for addressing the problem Representation –Assists in modeling the intended system –Assists in evaluating its behavior

4 Designs will include descriptions such as: The static structure of the system The data objects The algorithms The system packaging The component interactions The process being designed

5 Levels of design detail Level 1: The software system –High level design of the entire system Level 2: Division into subsystem or packages –Business Rules, User Interface, Database Access, System Dependencies Level 3: Division into classes within packages Level 4: Division into data and routines within classes Level 5: Internal routine design

6 Elements of good system architectures Program organization Major classes Data design Business rules User interface design Resource management Security Performance Scalability Interoperability

7 Elements of good system architectures Internationalization/localization Input/output Error processing Fault tolerance Architectural feasibility Robustness Buy-versus-build decisions Reuse decisions Change strategy General architectural quality

8 Good architecture looks natural and easy Objectives should be clearly stated Motivations for all decisions clearly stated Machine and language independent Parts of the architecture should not receive more attention than deserved Identify & explain risk areas, indicate steps taken to minimize risks Architecture should contain multiple views of system Programmer should be comfortable with architecture

9 Design errors occur if The design is not self-consistent The design and the specification are not consistent The design and the requirements are not consistent

10 Avoiding design errors Detect inconsistencies early –Late detection = more difficult and costly to correct errors Verify –Design checked against the specification –“Are we building the product right” Validate –Design checked against the user requirements –“Are we building the right product”

11 Fundamental Design Principles Simplicity Modularity Information hiding

12 Simplicity “A design should be as simple as possible, but no simpler” Albert Einstein Added extras & fancy trimmings might detract from the design’s purpose A simple design supports –Maintainability –Testability –Reliability –efficiency

13 Modularity Divide system into smaller modules –grouping functionality –Minimize interdependence –Disadvantage of interdependency = one change can have many repercussions Orthogonal system –components highly independent (decoupled) –Easier to design, build, test & extend –Can improve reliability & efficiency

14 Benefits of Modularity Increased Productivity Reduced Risk

15 Modularity: - Increased productivity - Changes are localized –change one component without affecting another –Reduces development time & testing time Easy module replacement –Modules easily replaced with another, if necessary Easier development –Easier to write smaller, self-contained components –Each module captures one feature of a problem Promotes reuse –Components with specific, well-defined responsibilities can be reused

16 Modularity: - Reduced risk - Problem code is isolated –If code in module faulty – problem less likely to spread –Also easier to replace module with new one Reduced fragility – system less fragile –Any problems caused by small changes made to area will be restricted to that area Increased testability –Easier to run tests on each component Increased flexibility

17 Typical Layer Diagram Each layer hiding unnecessary detail

18 Assessing modular structuring in SW Coupling –A measure of inter-module connectivity (the “form” and “strength” of the connection –E.g. more desirable to have modules A & B communicating using parameters than sharing common data area (global variables) Cohesion –A measure of how “functionally related” the components of the module are. –PrintReceipt module –code for printing the receipt NOT code for recording the receipt of money

19 Guidelines for creating software components (libraries of classes) Functionality –Component must have well-defined role Interfaces –Component must have well-defined interface Dependencies –Component should not have any context specific dependencies –Existing dependencies should be clearly specified

20 Information hiding Data structures within module to be concealed from other software components Direct access to data prevented Data can be made accessible via procedures, functions etc. Stack class – data structure (stack) – hidden Class methods Push & Pop allows stack to be accessed

21 Example designs NOT consistent with Fundamental Design Principles Many copies of “state” information - may lead to inconsistencies in system behavior Interface too complex – procedures or methods with too many parameters Excessively complex control structures Unnecessary replication of information, duplicate copies of information – passing complete record as parameter when only one field relevant Modules lacking functional strength – not well focused i.t.o focus

22 Further Fundamental Design Principles Find real-world objects Form consistent abstractions Encapsulate implementation details Inherit – when inheritance simplifies the design Identify areas likely to change Look for common design patterns

23 Find Real-World Objects Identify the objects (Employee & Client) and their attributes (data & methods: Name & UpdateAddress) Determine what operations can be performed on each object –Changing an employee’s title or billing rate Determine the parts of each object that will be visible to other objects –Public vs Private Define each object’s interface –Public & Protected

24 Form Consistent Abstraction Abstraction –The ability to engage with a concept while safely ignoring some of its irrelevant details –Allows developer to focus on interface without having to worry about class’s internal workings The real world “door” example –Rectangular piece of material with hinges and a doorknob / door handle –When using the door – not concerned with individual fibers or workings of hinges or doorknob / door handle

25 Encapsulate Implementation Details Abstraction allows you to look at the object at high level of detail Encapsulation prohibits you from looking at the object at any other level of detail –Hides the details of the complex concept

26 Allows a new class to be defined as a specialization of another class. –New class automatically inherits the features of the class it is created from –Can add additional features or change or suppress inherited features Employee PartTimeEmployee FullTimeEmployee Inherit -When inheritance simplifies the design

27 Identify areas likely to change Isolate areas likely to change to limit the effect of the change to one routine / class –Change thus confined to small area

28 Common design patterns for a GOOD DESIGN Most problems similar to past problems Thus, can be solved using similar solution/patterns Simplicity –“as simple as possible, but no simpler” design System Structure –Well structured design, consistent with modularity and information hiding –Simplified using abstraction, encapsulation & inheritance Quality factors –Adhere to quality assessment criteria (Chapter 1)

29 Design Practices Iterate Divide and conquer Top-down and bottom-up design approaches –composition strategy & decomposition strategy Collaborative design Capturing your design work (see next slide)

30 Capturing your design work Insert design documentation into the code itself Capture design discussions and decisions on Web pages Write summaries Use a digital camera Save design flip charts Use CRC (Class, Responsibility, Collaborator) cards Create UML diagrams at appropriate levels of detail

31 Design Representations Help with the process of modeling the intended system and with evaluating its behavior. “black box” – describes what a system does “white box” – describes how it is to do it.

32 Black Box representation - what

33 White box representations - how

34 Design Methods and Patterns Provide strategic guidance for the designer –Suggesting how to generate design solutions by describing tasks to be performed and ordering sequence

35 Design Methods and Patterns

36 Design Methods and Patterns Standard ways of combining objects and classes to solve common design problems Offer generic solutions to a problem –By describing particular problem and –A strategy for addressing problem –Allowing designers to use solution repeatedly Example: The development of the arched bridge –Once basic idea established, model can be adapted and extended to create variety of bridges: large, small, single or multiple arches.

37 Design Methods and Patterns The proxy design pattern

38 Design Methods and Patterns The proxy design pattern – Class Diagram

39 Design Methods and Patterns The proxy design pattern – Sequence Diagram

40 Using a catalogue of Design Patterns Specify the problem Select the category of pattern that is appropriate to the design activity involved Select the problem category appropriate to the problem Compare the problem description with the available set of patterns taken from the selected category Compare benefits and liabilities Select the pattern variant that most fits the problem

41 Prototyping Experimental, exploratory or evolutionary role You can typically prototype: –Architecture –New functionality in an existing system –Structure or contents of external data –Third party tools or components –Performance issues –User interface designs

42 Experimental & Exploratory (Disposable) Prototypes You can ignore: –Correctness – use dummy data –Completeness – limited functionality of prototype –Robustness – error checking incomplete / missing –Style – little documentation besides details of learning experience

43 Evolutionary Prototypes Forms skeleton of final system Helps to get from a requirement to some aspect of final system quickly and visibly Not fully functional, but contains all error- checking, structuring, documentation etc. Allows for “fit for purpose” evaluation & easy adding of functionality

44 Advantages of Evolutionary Prototypes Users get to see something working quickly Developers build a structure to work in You have an integration platform You have something to demonstrate You have a better feel for the program.

45 Prototyping guidelines Dispose of disposable prototypes Prototyping for the client will demand the client’s time Choose appropriate tools Make sure everyone knows that the prototype is not the real deal

46 The Specification Trap Specification will never capture every detail of a system or its requirements – users not 100% certain of their needs Diagramming techniques and formal methods are not always able to convey details in a natural way An overly descriptive design restricts the programmer

47 Flexibility and Adaptability Scenario 1 During test phase, decided database system too slow – need to be changed to one from another vendor. How easily will this be to do? Is database access code entangled – will it be a nightmare to make the change.

48 Flexibility and Adaptability Scenario 2 Project begins as client-server model. Later decided that servers are too expensive for some clients, they want a stand-alone version. How hard will it be for you to oblige?

49 Duplicating Knowledge Follow the “don’t duplicate” principle Categories of duplication: Imposed duplication –Environment seems to make duplication unavoidable Inadvertent duplication –Developers introduce duplication without realising it Impatient duplication –Developers get lazy and duplicate as it seems easier. Inter-developer duplication –Information duplicated by multiple team members

50 Gently exceeding your user’s expectations Balloon or ToolTip help Keyboard shortcuts A quick reference guide as a supplement to the user’s manual Colourisation Log file analysers Automated installation Tools for checking the integrity of the system The ability to run multiple versions of the system for training A splash screen customized for their organization

51 Further Principles and Practices Design and plan carefully Avoid complexity Make appropriate technology choices Etc.