1 / 24

Architecture: Layers and Packages

Architecture: Layers and Packages. Architecture. Often a system is composed of multiple packages/subsystems.

Download Presentation

Architecture: Layers and Packages

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. Architecture: Layers and Packages Software Design-Layering and Packaging

  2. Architecture • Often a system is composed of multiple packages/subsystems. • Some 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. • Example: • An information system connects to a use interface and a persistent storage mechanism. • How does one show subsystems/packages and their interactions in UML ? Software Design-Layering and Packaging

  3. Object Store UPC Quantity Cash Cash Balance Record Sales Authorize payments End Sale Enter Item Make Payment Storage Three tier architecture (1) Presentation layer Application logic Persistent storage Database Software Design-Layering and Packaging

  4. Three tier architecture (2) • Separates the application logic into a distinct middle layer. • Presentation layer (mostly) free of application processing. • Middle layer communicates with the back-end layer. Would you prefer a two-tier architecture? (Obtained by placing application logic into the presentation layer.) Software Design-Layering and Packaging

  5. Payment Sale DBInterface ReportGenerator Database Decomposing the application layer POSTApplet Presentation Domain concepts Application logic services Storage Software Design-Layering and Packaging

  6. Multi-tiered architecture • Multi-tiered architecture useful when: • The application logic needs to be split and isolated into multiple layers. • The application logic needs to be distributed amongst several computers. • Development of components needs to be distributed amongst various developers. Software Design-Layering and Packaging

  7. Deployment • A 3-tier architecture may be deployed in various configurations. • Presentation and app logic on one computer, database on a server. • Presentation on client computer, app logic on application server, and database on a data server. Software Design-Layering and Packaging

  8. Communication Across Layers [1] • Requests from actors, i.e. system operations, go via the Presentation Layer to the Application or the Domain layer. • Note that Presentation objects are not shown in the SSD. • How would you handle requests from secondary actors? Software Design-Layering and Packaging

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

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

  11. Sales Core elements Packages Domain concepts Software Design-Layering and Packaging

  12. Domain Services Presentation Database Package diagrams [1] Presentation App. logic Storage Software Design-Layering and Packaging

  13. Domain Presentation Object DB interface Relational DB interface Communication Reporting B A A has knowledge of B. Relational DB OO DB Package diagrams [2] App frameworks and support libraries Software Design-Layering and Packaging

  14. Presentation Swing Text Pricing Sales Payments Persistence Jess Domain Tech Services Service Access Inventory Package diagrams: Coupling Only partial coupling shown. Software Design-Layering and Packaging

  15. Presentation:: Swing Presentation:: Text Domain::Sales Domain:: POSRuleEngine Technical Services:: Authorization Package diagrams: Alternate Notation UML path name expression: <PackageName::<TypeName> Software Design-Layering and Packaging

  16. Identifying packages • Layers of an architecture represent vertical tiers. • Partitions represent horizontal tiers, e.g. the Services layer may be divided into Security and Reporting. • Upward and downward communication is feasible across components in a vertical layer. This is also known as a “relaxed layer” architecture. Software Design-Layering and Packaging

  17. Packaging: Guidelines [1] • Java provides package support. Hence reverse engineering can be used to generate package diagrams. • Packages developed during design might change during implementation. Reverse engineering is used to get the up-to-date diagrams. Software Design-Layering and Packaging

  18. Packaging: Guidelines [2] • Package functionally cohesive vertical and horizontal slices: e.g. Domain package: contains Sales and Pricing packages. • Package a family of related interfaces. • Package by work and by clusters of unstable classes. • Most responsible classes are likely to be most stable. • Factor out independent types. Software Design-Layering and Packaging

  19. 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.” • Upward communication: • The Observer pattern: Make the GUI object appear as an object that implements an interface. • A presentation façade object that receives requests from below. Software Design-Layering and Packaging

  20. Domain Presentation Not a GUI class. Just a plain object that adds a level of indirection. Register ProcessSaleFrame Sale UIFacade Example of “downward” communication Software Design-Layering and Packaging

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

  22. Domain Core/Misc. Sales Products Payments Authorization Transactions Package diagrams: Domain Model Packages in POS Software Design-Layering and Packaging

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

  24. Summary • What did we learn? • What is architecture? • Why use multi-tiered architecture? • What is deployment? • What are package diagrams? Software Design-Layering and Packaging

More Related