Architecture layers and packages
This presentation is the property of its rightful owner.
Sponsored Links
1 / 24

Architecture: Layers and Packages PowerPoint PPT Presentation


  • 50 Views
  • Uploaded on
  • Presentation posted in: General

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Architecture layers and packages

Architecture: Layers and Packages

Software Design-Layering and Packaging


Architecture

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


Three tier architecture 1

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


Three tier architecture 2

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


Decomposing the application layer

Payment

Sale

DBInterface

ReportGenerator

Database

Decomposing the application layer

POSTApplet

Presentation

Domain concepts

Application logic

services

Storage

Software Design-Layering and Packaging


Multi tiered architecture

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


Deployment

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


Communication across layers 1

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


Communication across layers 2

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


Layers and architectural patterns 1

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


Packages

Sales

Core elements

Packages

Domain concepts

Software Design-Layering and Packaging


Package diagrams 1

Domain

Services

Presentation

Database

Package diagrams [1]

Presentation

App. logic

Storage

Software Design-Layering and Packaging


Package diagrams 2

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


Package diagrams coupling

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


Package diagrams alternate notation

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


Identifying packages

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


Packaging guidelines 1

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


Packaging guidelines 2

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


Visibility between packages model view separation principle

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


Example of downward communication

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


Example of upward communication

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


Package diagrams domain model packages in pos

Domain

Core/Misc.

Sales

Products

Payments

Authorization

Transactions

Package diagrams: Domain Model Packages in POS

Software Design-Layering and Packaging


Mapping to implementation packages java

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


Summary

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


  • Login