Download presentation
Presentation is loading. Please wait.
Published byJulian Allen Modified over 8 years ago
1
Elaboration: Iteration 2
2
Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early, realistic, and continuous verification of quality and correctness, So that early feedback guides the developers to improve the system, finding its "true path."
3
Elaboration: Iteration 2 Basics Iteration 1 ends with : Customers have been regularly engaged in evaluating the partial system And the customers get to see early visible progress with the system.
4
Elaboration: Iteration 2 Basics teration-2 largely ignores requirements analysis and domain analysis Focuses on object design with responsibilities and GRASP, and applying some (GoF) "gang-of- four" design patterns
5
UML Tools and UML as Blueprint There are three ways to apply UML include: 1) UML as sketch. 2) UML as blueprint 3) UML as programming language
6
UML Tools and UML as Blueprint There are three ways to apply UML include: 2) UML as blueprint This applies to both code and diagram generation. Detailed diagrams used to guide some code generation (e.g., Java). Diagrams are used to visualize the code base. After generating code, many fine details are usually filled in by developers while programming, using UML.
7
UML Tools and UML as Blueprint 3) UML as programming language Complete executable specification of a software system, with UML. Executable code will be automatically generated (or a virtual machine directly interprets UML), but it is not normally seen or modified by developers
8
GRASP: More Object Design
9
GRASP basic patterns: Information Expert, Creator, High Cohesion, Low Coupling, and Controller
10
GRASP: More Object Design Next four GRASP patterns are: Polymorphism Pure Fabrication Indirection Protected Variations
11
GRASP: More Object Design 1) Polymorphism Pattern Name: Polymorphism Problem: How handle alternatives based on type? How to create pluggable software components? Solution: When related alternatives or behaviors vary by type (class), assign responsibility for the behavior using polymorphic operations to the types for which the behavior varies
12
GRASP: More Object Design 1) Polymorphism Alternatives based on type : Conditional variation is a fundamental method in programs. If a program is designed using if-then-else or case statement conditional logic, then if a new variation arises, it requires modification of the case logic often in many places. This approach makes it difficult to easily extend a program with new variations because changes may be required in several places wherever the conditional logic exists.
13
GRASP: More Object Design 1) Polymorphism Pluggable software components In client-server relationships, how can you replace one server component with another, without affecting the client?
14
GRASP: More Object Design 1) Polymorphism Example In the NextGen POS In POS, multiple external third-party tax calculators that must be supported. Each tax calculator has a different interface, but varying behavior to adapt to each of these external fixed interfaces. One product may support a raw TCP socket protocol, another may offer a SOAP interface, and third may offer a Java RMI interface. Since the behavior of calculator varies by the type of calculator, by Polymorphism we should assign the responsibility for different calculator. The following figure, shows the Polymorphism in adapting to different external tax calculators for POS
15
GRASP: More Object Design 1) Polymorphism
16
GRASP: More Object Design 1) Polymorphism Polymorphism has several related meanings. In this context, it means "giving the same name to services in different objects"
17
GRASP: More Object Design 2) Pure Fabrication Pattern Name: Pure Fabrication Problem: What object should have the responsibility, when you do not want to violate High Cohesion and Low Coupling? Solution: Assign a highly cohesive set of responsibilities to an artificial class that does not represent a problem domain concept something made up, to support high cohesion, low coupling, and reuse.
18
GRASP: More Object Design 2) Pure Fabrication Such a class is a fabricated. Ideally, the responsibilities assigned to this fabrication support high cohesion and low coupling, so that the design of the fabrication is very clean. Finally, a pure fabrication implies making something up
19
GRASP: More Object Design 2) Pure Fabrication Example POS For example, suppose that support is needed to save Sale instances in a relational database. By Information Expert, there is some justification to assign this responsibility to the Sale class itself, because the sale has the data that needs to be saved. But consider the following implications:
20
GRASP: More Object Design 2) Pure Fabrication Example POS The task require is a relatively large number of supporting database-oriented operations, none related to the concept of sale-ness, so the Sale class becomes incohesive. The Sale class has to be coupled to the database interface (such as JDBC in Java), so its coupling goes up Saving objects in a database is a very general task for which many classes need support.
21
GRASP: More Object Design 2) Pure Fabrication Example POS A reasonable solution is to create a new class that is responsible for saving objects in the database; call it the PersistentStorage. This class is a Pure Fabrication of the imagination. PersistentStorage is not a domain concept, but something made up or fabricated for the convenience of the software developer.
22
GRASP: More Object Design 2) Pure Fabrication Example POS This Pure Fabrication solves the following design problems: The Sale remains well-designed, with high cohesion and low coupling. The PersistentStorage class is itself relatively cohesive, having the main purpose of storing in Database. The PersistentStorage class is a very generic and reusable object.
23
GRASP: More Object Design 3) Indirection Pattern Name: Indirection Problem: Where to assign a responsibility, to avoid direct coupling between two (or more) things? How to de-couple objects so that low coupling is supported and reuse potential remains higher? Solution: Assign the responsibility to an intermediate object to mediate between other components or services so that they are not directly coupled.
24
GRASP: More Object Design 3) Indirection The intermediary creates an indirection between the other components
25
GRASP: More Object Design 4) Protected Variations Pattern Name: Protected Variations Problem: How to design objects, subsystems, and systems so that the variations or instability in these elements does not have an undesirable impact on other elements? Solution: Identify points of predicted variation or instability; assign responsibilities to create a stable interface around them.
26
GRASP: More Object Design 4) Protected Variations For example, the external tax calculator problem and its solution with Polymorphism illustrate Protected Variations. The point of instability or variation is the different interfaces or APIs of external tax calculators. Internal objects collaborate with a stable interface; the various adapter implementations hide the variations to the external systems.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.