Presentation is loading. Please wait.

Presentation is loading. Please wait.

October 23, 2001 Software Design-Layering and Packaging1 Architecture: Layers and Packages.

Similar presentations


Presentation on theme: "October 23, 2001 Software Design-Layering and Packaging1 Architecture: Layers and Packages."— Presentation transcript:

1 October 23, 2001 Software Design-Layering and Packaging1 Architecture: Layers and Packages

2 October 23, 2001 Software Design-Layering and Packaging2 Architecture zOften a system is composed of multiple packages/subsystems. zExample: yAn information system connects to a use interface and a persistent storage mechanism. zHow does one show subsystems/packages and their interactions in UML ? ySome packages may not be just a conceptual group of things. Instead they are subsystems with behavior and interfaces. For example, java.util is not a subsystem, it is a package. A PersistenceEngine is a subsystem.

3 October 23, 2001 Software Design-Layering and Packaging3 Three tier architecture (1) UPC Cash Quantity Balance Enter ItemEnd SaleMake Payment Object Store Cash Presentation layer Persistent storage Application logic Record SalesAuthorize payments Storage Database

4 October 23, 2001 Software Design-Layering and Packaging4 Three tier architecture (2) zSeparates the application logic into a distinct middle layer. zPresentation layer (mostly) free of application processing. zMiddle layer communicates with the back-end layer. Would you prefer a two-tier architecture? (Obtained by placing application logic into the presentation layer.)

5 October 23, 2001 Software Design-Layering and Packaging5 Decomposing the application layer Application logic Presentation POSTApplet ReportGeneratorDBInterfaceSalePayment Domain concepts services Storage Database

6 October 23, 2001 Software Design-Layering and Packaging6 Multi-tiered architecture zMulti-tiered architecture useful when: yThe application logic needs to be split and isolated into multiple layers. yThe application logic needs to be distributed amongst several computers. yDevelopment of components needs to be distributed amongst various developers.

7 October 23, 2001 Software Design-Layering and Packaging7 Deployment zA 3-tier architecture may be deployed in various configurations. yPresentation and app logic on one computer, database on a server. yPresentation on client computer, app logic on application server, and database on a data server.

8 October 23, 2001 Software Design-Layering and Packaging8 Communication Across Layers [1] zRequests from actors, i.e. system operations, go via the Presentation Layer to the Application or the Domain layer. zHow would you handle requests from secondary actors? zNote that Presentation objects are not shown in the SSD.

9 October 23, 2001 Software Design-Layering and Packaging9 Communication Across Layers [2] zCommunication from the presentation layer to the lower layers is referred to as “downward communication.” zCommunication from the lower layers to presentation layer is referred to as “upward communication.” How to achieve such communications while minimizing coupling?

10 October 23, 2001 Software Design-Layering and Packaging10 Layers and Architectural patterns [1] zArchitectural layers define “big parts” of a system. zArchitectural design patterns are used for designing communications amongst layers (or “big parts”). zArchitectural design patterns include Façade and Observer.

11 October 23, 2001 Software Design-Layering and Packaging11 Domain concepts Packages Core elements Sales

12 October 23, 2001 Software Design-Layering and Packaging12 Package diagrams [1] Presentation DomainServices Presentation App. logic Storage Database

13 October 23, 2001 Software Design-Layering and Packaging13 Package diagrams [2] Presentation Domain Relational DB interface CommunicationObject DB interface App frameworks and support libraries Relational DB OO DB Reporting A B A has knowledge of B.

14 October 23, 2001 Software Design-Layering and Packaging14 Package diagrams: Coupling Presentation SwingText Domain PricingSales Service Access Payments Inventory Tech Services PersistenceJess Only partial coupling shown.

15 October 23, 2001 Software Design-Layering and Packaging15 Package diagrams: Alternate Notation Presentation:: Swing Domain::SalesDomain:: POSRuleEngine Presentation:: Text UML path name expression: Technical Services:: Authorization

16 October 23, 2001 Software Design-Layering and Packaging16 Identifying packages zLayers of an architecture represent vertical tiers. zUpward and downward communication is feasible across components in a vertical layer. This is also known as a “relaxed layer” architecture. zPartitions represent horizontal tiers, e.g. the Services layer may be divided into Security and Reporting.

17 October 23, 2001 Software Design-Layering and Packaging17 Packaging: Guidelines [1] zJava provides package support. Hence reverse engineering can be used to generate package diagrams. zPackages developed during design might change during implementation. Reverse engineering is used to get the up-to-date diagrams.

18 October 23, 2001 Software Design-Layering and Packaging18 Packaging: Guidelines [2] zPackage functionally cohesive vertical and horizontal slices: e.g. Domain package: contains Sales and Pricing packages. zPackage by work and by clusters of unstable classes. zPackage a family of related interfaces. zMost responsible classes are likely to be most stable. zFactor out independent types.

19 October 23, 2001 Software Design-Layering and Packaging19 Visibility between packages: Model View Separation Principle What visibility should packages have to the Presentation Layer?: Avoid direct coupling between window objects and the “Model.” zUpward communication: zThe Observer pattern: Make the GUI object appear as an object that implements an interface. zA presentation façade object that receives requests from below.

20 October 23, 2001 Software Design-Layering and Packaging20 Example of “downward” communication Domain RegisterSale Presentation ProcessSaleFrameUIFacade Not a GUI class. Just a plain object that adds a level of indirection.

21 October 23, 2001 Software Design-Layering and Packaging21 Example of “upward” communication enterItem(id,qty) : Presentation:: swing:Process SaleFrame :Domain:: Sales:Register makeLineItem(spec,qty) s:Domain Sales:Sale enterItem(id,qty) Property listener (observer) onPropertyEvent(s,”sales.total”,total) :cashier Subject

22 October 23, 2001 Software Design-Layering and Packaging22 Package diagrams: Domain Model Packages in POS Domain Core/Misc.SalesProducts Authorization Transactions Payments

23 October 23, 2001 Software Design-Layering and Packaging23 Mapping to Implementation Packages (Java) com.foo.nextgen.ui.swing // Presentation packages com.foo.nextgen.ui.text com.foo.nextgen.domain.sales // Domain packages com.foo.nextgen.domain.pricing com.foo.util // Our team creates com.foo.boeingutilities

24 October 23, 2001 Software Design-Layering and Packaging24 Summary zWhat did we learn? yWhat is architecture? yWhy use multi-tiered architecture? yWhat is deployment? yWhat are package diagrams?


Download ppt "October 23, 2001 Software Design-Layering and Packaging1 Architecture: Layers and Packages."

Similar presentations


Ads by Google