1 / 20

Design Overview

Design Overview. Design Overview (Ch 6) Review of RAD System Design System Design Concepts System Design Goals (Global) System Design (Ch 7) Design Goals Software Architecture Boundary Use Cases SDD Subsystem Design Patterns (Ch 8) Interfaces (Ch 9) Mapping to Code (Ch 10). Re-Use.

milleredna
Download Presentation

Design Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design Overview • Design Overview (Ch 6) • Review of RAD • System Design • System Design Concepts • System Design Goals • (Global) System Design (Ch 7) • Design Goals • Software Architecture • Boundary Use Cases • SDD • Subsystem Design • Patterns (Ch 8) • Interfaces (Ch 9) • Mapping to Code (Ch 10)

  2. Re-Use • Design Patterns • Adapter, Bridge • Strategy, Command, Composite • Abstract Factory • Frameworks • Infrastructure • Middleware • Application • Whitebox / Blackbox • Libraries • Domain neutral • Independent and fine grain • Control passive • Components • Predefined instances (pre-compiled code) • Not modifiable

  3. Inheritance • Specification inheritance (recommended) • Interface inheritance • Re-use interface • Create a subtype • Example (from 3330): vehicle / truck / tanker • Implementation inheritance (use with caution) • Re-use (implementation) code • Example: List / OrderedList • Problems: • Not extensible (hard to change the implementation) • Not a subtype: can’t substitute for base class • C++ private inheritance overcomes subtype issue • Liskov Substitution Principle (LSP) • Definition: S is a subtype of T iff an object of type S can be substituted whenever an object of type T is expected • Principle: Use inheritance only for subtyping

  4. Delegation • Preferred for code reuse • Extensible: facilitates change of implementation • Does not create a false supertype • Delegation and Inheritance work together in design patterns

  5. Design Patterns • Name • Uniquely identifies pattern • Evokes details to designer • Problem description • Describes situations appropriate for using the pattern • Usually includes modifiability, extensibility, and nonfunctional design goals • Solution • State as a set of collaborating entities (mostly classes and objects) • Typically includes an illustration • Consequences • Describe the trade-offs and alternatives with respect to the design goals being addressed

  6. Client ClientInterface LegacyClass Request() ExistingRequest() Adapter Request() Adaptor [A.2] adaptee

  7. Adaptor Example • C++: std::stack (or fsu::CStack) • Uses vector (existing code) to define stack interface • http://www.cs.fsu.edu/~lacher/courses/COP4530/lectures/adts/slide19.html • Note: “inheritance” is conceptual, but not necessarily realized by inheritance in the specific language!

  8. Bridge [A.3] (wikipedia)

  9. Arena LeagueStore LeagueStoreImplementor Stub Store XML Store JDBC Store Implementor Implementor Implementor Bridge Example (text fig. 8-7) imp

  10. Comparing Adaptor and Bridge • Using Inheritance and Delegation • Adaptor: inherits interface then delegates implementation • Bridge: delegates abstract implementation then derives specific implementations • Can derive from either construct • Adaptor • Assumes existing (“legacy”) code • Adapted code may be old and ugly or modern and useful • Either way, you are not intending to change the existing code • Bridge • Assumes you have not yet implemented the interface • Facilitates different implementation choices

  11. Application (client) NetworkConnection (context) NetworkInterface (strategy) open() send() close() receive() send() setNetworkInterface() receive() LocationManager (policy) Ethernet WaveLAN UMTS open() open() open() close() close() close() send() send() send() receive() receive() receive() Strategy [A.9] (Text fig 8-10)

  12. Strategy Example • The Strategy class (NetworkInterface) provides common interface to various concrete networks • The Context class (NetworkConnection) gives client access to connection methods • Client is a mobile application • Policy monitors current location and (re)configures network connections with appropriate network interfaces

  13. Match play() replay() GameBoard Command [A.4] (text fig. 8-13) * Move execute() «binds» TicTacToeMove execute() ChessMove execute()

  14. move() resize() Composite [A.5] * Component move() resize() Label Button Checkbox Composite Window Panel Applet

  15. Top panel Main panel Button panel Figure 8-14, Anatomy of a preference dialog. Aggregates, called Panels, are used for grouping user interface objects that need to be resized and moved together.

  16. Figure 8-15, UML object diagram for the user interface objects of Figure 8-14. prefs:Window top:Panel main:Panel buttons:Panel title:Label c1:Checkbox ok:Button c2:Checkbox cancel:Button c3:Checkbox c4:Checkbox

  17. TheftApplication HouseFactory createBulb() createBlind() EIBFactory LuxmateFactory createBulb() createBulb() createBlind() createBlind() LightBulb Blind EIBBulb LuxmateBulb EIBBulb LuxmateBulb Abstract Factory [A.1]

  18. Façade [A.6] Encapsulate complex systems

  19. Observer [A.7] (fig 8-22) observers Subject Observer * 1 subscribe(Subscriber) update() unsubscribe(Subscriber) notify() GameBoard MatchView state gameBoard getState() update() playMove()

  20. Proxy [A.8] • Whenever direct access is undesirable (security, performance, flexibility)

More Related