Download presentation
Presentation is loading. Please wait.
2
Eva TrosborgSlide no.: 1Elaboration Iteration 2 Object Oriented design and more patterns Fall 2005 UML Tools and UML as Blueprint (chapter 22, p 397) Guidelines p 404 Iteration 2 – More Patterns (chapter 24, p 407) GRASP: More Objects with Responsibilities (chapter 25, p 413) Applying GoF Design Patterns (chapter 26, p 435) by Eva Trosborg
3
Slide no.: 2Elaboration Iteration 2 Sources to this lesson Supported by Larman Chapter 22 - 26
4
Eva TrosborgSlide no.: 3Elaboration Iteration 2 Ways to apply UML UML as sketch UML as blueprint UML as programming language What is the current status? Which problems / challenges can you see ?
5
Eva TrosborgSlide no.: 4Elaboration Iteration 2 Forward, Reverse, and Round-Trip Engineering Forward engineering –Generating code from diagrams Reverse engineering –Generating diagrams from code Round-trip engineering –Generating in either direction and can synchronize between UML diagrams and code Status ? Still long way to go
6
Eva TrosborgSlide no.: 5Elaboration Iteration 2 Report on Valuable UML tool features? “get in the way” more than help ? Reverse engineering as a Visualization learning aid to understand existing code. Future ? SW tools are fast-changing www.objectsbydesign.com/tools/umltools_byCompany.html
7
Eva TrosborgSlide no.: 6Elaboration Iteration 2 Any sufficiently advanced bug is indistinguishable from a feature – Rich Kulawiec Generalization Is the activity of identifying commonality among concepts and defining superclass (general concept) and subclass (specialized concept) relationships Guideline Create a conceptual subclass of a superclass when: 1.The subclass has additional attributes of interest 2.The subclass has additional associations of interest 3.The subclass concept is operated on, handled, reacted to, or manupulated differently than the superclass or other superclasses, in noteworthy ways
8
Eva TrosborgSlide no.: 7Elaboration Iteration 2 Fig. 32.1 Generalization- specialization hierarchy
9
Eva TrosborgSlide no.: 8Elaboration Iteration 2 Fig. 32.6 Legal conceptual class partition, but is it useful ?
10
Eva TrosborgSlide no.: 9Elaboration Iteration 2 Fig. 2.4 Evolutionary analysis and design – the majority in early iterations
11
Eva TrosborgSlide no.: 10Elaboration Iteration 2 From Iteration 1 -> 2 When iteration-1 ends –All SW has been tested: unit, acceptance, load, usability … (UP idea is to do early, realistic, and continuous verification of quality and correctness) –Customers engaged in evaluating the partial system to obtain feedback for adaptation and clarification of requirement and see early visible progress –The system has been completely integrated and stabilized as a base lined internal release –An iteration planning meeting to resolve questions and identify major tasks in the next iteration –Reverse engineering diagrams from code –Usability analysis and engineering for the UI (outside scope) –Database modeling –2 days requirement workshop (near the end of iteration-1 and again near the end of iteration-2) Use of patterns to create a solid design
12
Eva TrosborgSlide no.: 11Elaboration Iteration 2 The Agile Principles Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan
13
Eva TrosborgSlide no.: 12Elaboration Iteration 2 Principles behind the Agile Manifesto Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale. Business people and developers must work together daily throughout the project. Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. Working software is the primary measure of progress. Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely. Continuous attention to technical excellence and good design enhances agility. Simplicity - the art of maximizing the amount of work not done - is essential. The best architectures, requirements, and designs emerge from self-organizing teams. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.
14
Eva TrosborgSlide no.: 13Elaboration Iteration 2 Iteration 2 – More Patterns As from the figures in Larman
15
Eva TrosborgSlide no.: 14Elaboration Iteration 2 Design Patterns How to choose (or construct) objects to be responsible to carry out operations? –What rational principles can be methodically applied to guide the design of responsibilities and object interactions? –“It seems right” or “it’s natural” is not good enough!!! Especially for novices Design Pattern –Principles or idioms of design codified in a structured format describing the problem it solves and a solution for the problem
16
Eva TrosborgSlide no.: 15Elaboration Iteration 2 Gang of Four The GoF book –Gamma, E., Helm, R., Johnson, R., and Vlissides, J., Design Patterns, Addison-Wesley, 1995. A Related Book on Analysis Patterns –Fowler, M., 1996, Analysis Patterns: Reusable Object Models, Addison-Wesley, 1996.
17
Eva TrosborgSlide no.: 16Elaboration Iteration 2 Singleton (Many) classes need access to a single object –Could pass the object as a parameter through (possibly) many messages –Alternatively, globally reference the one object A class, not an object
18
Eva TrosborgSlide no.: 17Elaboration Iteration 2 Singleton Problem –Exactly one instance of a class is allow; it is a “singleton”. –Many objects need to access the singleton Solution –In the singleton class, define a method that returns the one singleton class instance In languages that do not provide for class methods, instead use a global function –Other objects can request the singleton from the class Motivation –Class (type definitions) are generally global in scope for most languages with the exception of import/export –Asking the class for its instance does not increase coupling
19
Eva TrosborgSlide no.: 18Elaboration Iteration 2 Remote Proxy Problem –How to represent non-local components? E.g., Credit Card Authorization Service, Database, etc. Solution –Create a class that “stands in” for the remote class
20
Eva TrosborgSlide no.: 19Elaboration Iteration 2 Remote Proxy Problem –The system must communicate with a component in another address space (e.g., on another machine). Who should be responsible for contacting the component? Solution –Make a local class the represents the remote component. (Local objects should think of it as actually being the component.) This local proxy for the remote object handles all interaction with the actual component. Motivation –Localize remote access behavior (which is likely to change)
21
Eva TrosborgSlide no.: 20Elaboration Iteration 2 Proxy Problem –Direct access to a component is not desired or possible. Solution –Make a local class the represents the component. (Local objects should think of it as actually being the component.) This local proxy for the remote object handles all interaction with the actual component. Motivation –Localize access behavior (which is likely to change)
22
Eva TrosborgSlide no.: 21Elaboration Iteration 2 Facade & Device Proxy Problem –How can object-oriented system be cleanly connected to non-object- oriented (legacy) systems? –How can hardware devices or operating system functions be represented? Solution –Create a class that encapsulates the behavior of the legacy system or device
23
Eva TrosborgSlide no.: 22Elaboration Iteration 2 Facade & Device Proxy Facade Proxy –Problem How can a common interface to a variety of functions or interface (such a provided by a legacy system) be provide within an object-oriented system? –Solution Define a single class that encapsulates the behavior of all the functions Device Proxy –Problem How can an interface to a hardware device be provided within an object- oriented system? –Solution Define a single class that encapsulates the behavior of the device
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.