2. Agenda
ο What is Architecture?
ο Importance of Architecture in Software
ο Software Architecture Principles
ο Software Architecture tools
ο Software Architecture patterns
ο UML introduction
ο RUP introduction
3. Definition
ο The Software architecture of a program or computing
system is the Structure or structures of the system,
which comprise software elements, the externally visible
properties of those elements and the relationships
among them.
4. Why Architecture is important?
ο Handling complexity
ο Communication among stakeholders
ο Early Design Decisions
ο Software Architecture is a transferable, reusable model
6. Architecture Principles
ο Single Responsibility Principle
ο every class should have a single responsibility, and that responsibility should be entirely encapsulated
by the class
ο Open β Closed Principle (OCP)
ο Software Entities (Classes, Modules, Functions, etc.) should be open for extension but closed for
modifications.
ο Liscov Substitution Principle (LSP)
ο Functions that use pointers or references to base classes must be able to use(Substitute base class)
objects by derived classes without knowing it.
ο Interface Segregation Principle (ISP)
ο no client should be forced to depend on methods it does not use
ο Dependency Inversion Principle
ο A. High level modules should not depend on low level module. Both should depend on abstraction.
Both should depend on Abstraction.
ο B. Abstraction should not depend on details.
ο DRY (Donβt Repeat Yourself)
ο Every piece of knowledge must have a single, unambiguous, authoritative representation within a
system.
ο YAGNI - You ain't gonna need it
ο Always implement things when you actually need them, never when you just foresee that you may
need them.
ο KISS - Keep it simple, Stupid!
ο Most systems work best if they are kept simple rather than made complex, therefore simplicity
should be a key goal in design and unnecessary complexity should be avoided.
7. Architecture Patterns
An Architecture style or Pattern is
ο a description of the component and connector types
involved in the style
ο the collection of rules that constrain and relate them
Example: MVC(Model-View-Controller), Layered, Multitier,
SOA(Service Oriented Architecture), Event Driven,
ETL(Extract-Transform-Load),EAI(Enterprise Application
Integration), ESB(Enterprise Service Bus), MFT(Managed
File Transfer), Data Warehouse, Analytical Reporting
8. Model-View-Controller
ο Main goal:
facilitate and optimize the implementation of interactive systems,
particularly those that use multiple synchronized presentations of
shared information.
ο Key idea:
separation between the data and its presentation, which is carried by
different objects.
ο Controllers typically implement event-handling mechanisms that are
executed when corresponding events occur.
ο Changes made to the model by the user via controllers are directly
propagated to corresponding views. The change propagation
mechanism can be implemented using the observer (design)
pattern.
9. Layered Pattern
ο Context
You are working with a large, complex system and you want to
manage complexity by decomposition.
ο Problem
How do you structure an application to support such operational
requirements as maintainability, scalability, extensibility,
robustness, and security?
ο Solutions
Compose the solution into a set of layers. Each layer should be
cohesive and at Roughly the same level of abstraction. Each layer
should be loosely coupled to the layers underneath.
10. Layered Pattern contβ¦
ο Layering consists of a hierarchy of layers, each providing
service to the layer above it and serving as client to the layer
below.
ο Interactions among layers are defined by suitable communication
protocols.
ο Interactions among non-adjacent layers must be kept to the
minimum possible.
ο Layering is different from composition
ο higher-layers do not encapsulate lower layers
ο lower layers do not encapsulate higher layers (even though
there is an existence dependency)
11. Three Tier Architecture
ο Context
You are building a business solution using layers to organize your
application.
ο Problem
How do you organize your application to reuse business logic,
provide deployment flexibility and conserve valuable resource
connections?
ο Solutions
ο Create three layers: presentation, business logic and data
access.
ο Locate all database-related code, including database clients
access and utility components, in the data access layer.
ο Eliminate dependencies between business layer components and
data access components.
ο Either eliminate the dependencies between the business layer
and the presentation layer or manage them using the Observer
pattern.
13. Design Pattern
A design pattern systematically names, motivates, and explains a
general design that addresses a recurring design problem in object-
oriented systems. It describes the problem, the solution, when to
apply the solution, and its consequences. It also gives
implementation hints and examples. The solution is a general
arrangement of objects and classes that solve the problem. The
solution is customized and implemented to solve the problem in a
particular context.
Basic Design Patterns
ο Creational Design Patterns (Factory, Abstract Factory, Builder,
Prototype, Singleton)
ο Structural Design Pattern (Adapter, bridge, Composite, Decorator,
Façade, Flyweight, Proxy)
ο Behavioral Design Pattern (Chain of Responsibility, Command,
Interpreter, Iterator, Mediator, Memento, Observer, State,
Strategy, Template, Visitor)
14.
15. Modeling
ο Modeling is a way of thinking about the problems using models
organized around the real world ideas.
ο A modeling method comprises a language and also a
procedure for using the language to construct models.
ο modeling is the only way to visualize your design and check it
against requirements before your crew starts to code.
ο easier for developers, software architects and customers to
communicate on a common platform.
ο we create a number of views of the system being described
β’ Each view is needed for a full understanding of the system
β’ Each view has information that is unique to that view.
β’ Each view has information that appears in other views
16. Motivations for UML
ο We need a modeling language to:
o Help convey clear representations of user
requirements for clearer communication among
project stakeholders (concerned parties:
developers, customer, etc).
o help develop efficient, effective and correct
designs, particularly Object Oriented designs.
o give us the βbig pictureβ view of the project.
17.
18. UML 2 Diagrams
Structure diagrams define the static Behavior diagrams capture
architecture of a model. They are the varieties of interaction
used to model the 'things' that and instantaneous state
make up a model - the classes, within a model as it
objects, interfaces and physical 'executes' over time.
components.
20. Class Diagram
ο Each class is represented by a rectangle divided into three sections:
o The first section is class name.
o The second section is attributes the class contain.
o The third section is operations of the class
ο The lines connecting classes show the communication relationships
between the classes.
β’ Developers use Class diagrams to actually develop the classes.
β’ Analysts use Class diagrams to show the details of system.
β’ Architects looks at Class diagram to see the design of the system.
o If one class contains too much functionality, an architect can see
this in the Class diagram and split out it.
23. Class Diagram Sample
ο A veterinary system. Animals served, such as dogs and birds,
are tracked along with their owners. Since dogs and birds are
"a kind of" animal, we use a Generalization relationship
24. Aggregation
ο Aggregation is a kind of association
ο βis part ofβ relation
o a book is part of a library catalog
o a library catalog has any number of books
Objective
o may make a diagram more readable
o maps to the same code as any other association
25. Composition
ο Composition is a kind of aggregation with a well-defined
meaning!
ο Example
class Rectangle {
private Point[ ] p = new Point[ 4 ];
//the elements of p are never given out
Rectangle( int x, int y, int height, int width ) {
p[ 0 ] = new Point( x, y );
β¦}
β’ Meaning: each part belongs to exactly one composite
o When the composite is destroyed, the part is destroyed
o Parts cannot be shared among composites
26. Dependency
ο A depends on B
ο Any kind of βusesβ relation between classes that is not an
association or a generalization
Examples:
ο A instantiates B (but does not keep the reference)
ο A has operations that have objects of type B as parameters
Generally:
ο Class A cannot be used without class B
ο Dependency can also be used with packages
27. Interfaces
ο Class Rectangle implements interface Shape
ο Top: full representation
ο Bottom: elided representation
ο no operations of the interface can be shown
ο The relation between class and interface is a realization
ο Interfaces are a kind of class in UML
28. Abstract Classes
ο Abstract classes and operations
ο have names in italics
ο this is an other way to show generalizations
ο several arrows made into one
29. Package Diagram
ο A grouping mechanism
ο A package can contain any kind of
UML elements
Two uses:
ο to hide part of a diagram
ο to show the relationship between
large numbers of elements
31. Sequence Diagram
ο Shows the flow of functionality through a user story.
ο Users can look at these diagrams to see the specifics of their
business processing.
ο Analysts see the flow of processing in the Sequence
diagrams.
ο Developers see objects the need to be developed and
operations for those objects.
ο Quality assurance engineers can see the details of the
process and develop test cases based
34. Component Diagram
ο Show you a physical view of your model
ο The software components in your system, and relationships
between them.
ο There are two types of components on the diagram:
ο Executable component
ο Code library
ο Dependencies are drawn between the components (dahsed line).
ο Component dependencies show the compile-time and run-time
dependencies between the components.
35. Component Diagram Sample
Register.exe
Billing.exe
Billing
System
People.dll
User
Course.dll
Course
Student Professor
Course Course
Offering
39. RUP 4+1 view
ο Developed by Philippe Kruchten to describe the architectural
views needed to represent a software system.
ο Founded on the notion that different users need different views
of the system
ο Merges the technical aspects of a system with the requirements
that drive the system
40. RUP 4+1 view in Practice
ο Logical View
ο Models the translation of the system use cases into functional aspects
of the system
ο Focus is on the how specific functionality is satisfied by architectural
abstractions (i.e. use case realizations)
ο UML notation included most type of diagrams and elements(classes,
collaborations, state machines,β¦)
ο This is where the meat of most modeling occurs
ο Process View
ο The process view is intended to show the concurrent execution
aspects of a system and the collaborations needed to support them.
ο Usually expressed as tasks, threads, or active objects.
ο In practice rarely used in general IT application development except in
special circumstances
41. RUP 4+1 view in Practice
ο Implementation View
ο Concerned with the representation of the system as modules, libraries,
sub-systems and other software components
ο Shows the mapping of the design elements into their βdeliverableβ form
(ex. classes in a particular library)
ο Usually uses UML component representation
ο Deployment View
ο Describes the deployment of the software elements of the system to the
hardware elements and the relationships between those hardware
elements.
ο Very useful in distributed systems development.
ο Uses the UML deployment notation.
42. RUP 4+1 view in Practice
ο Use Case View
ο The overarching view that drives the rest of the system in use case
driven development
ο Models show the use cases and actors that define the requirements of
the system
ο Usually uses use case diagrams and activity diagrams along with
supporting documentation that describes the use cases
43. Architectural Goals & Constraints
The architecture will be formed by considering:
ο functional requirements, captured in the Use-Case Model, and
ο non-functional requirements, quality attributes.
However these are constraints imposed by the environment in which
the software must operate that will shape the architecture :
ο need to reuse existing assets
ο imposition of various standards
ο need for compatibility with existing systems
44. Requirements
Functional Requirements defines the capabilities and functions that
a System must be able to perform successfully. These are defined in
Use Cases or User Stories.
Non-functional Requirements are often called the Quality
Attributes or simply Qualities or Cross cutting concerns of a system.
These can be divided into two main categories:
ο Execution Qualities e.g. security, reliability and usability which
are observable at the run time.(Dynamic)
ο Evolution Qualities e.g. Testability, maintainability, extensibility,
scalability, which are in the static structure of the system.
The plan for implementing functional requirements is detailed in the
system design. The plan for implementing non-functional
requirements is detailed in the system architecture.
Editor's Notes
AnOrderDetailcan be queried about itsItem, but not the other way around. The arrow also lets you know who "owns" the association's implementation; in this case,OrderDetailhas anItem.Multiplicities are single numbers or ranges of numbers. In our example, there can be only oneCustomerfor eachOrder, but aCustomercan have any number ofOrders.