Lecture 4 - Software Architecture
Lecture 4 - Software Architecture
Architecture
DR. ALHASSAN ADAM
Lecture Outline
5
Some Obvious Parallels
6
Deeper Parallels
7
Deeper Parallels (cont’d)
8
Software Architectural Diagram
Building Architecture vs Software
Architecture
One of the differences between building architecture and software
architecture is that a lot of decisions about a building are hard to
change.
It is hard to go back and change your basement, though it is possible.
There is no theoretical reason that anything is hard to change about
software.
If you pick any one aspect of software then you can make it easy to
change, but we don’t know how to make everything easy to change.
Making something easy to change makes the overall system a little
more complex, and making everything easy to change makes the entire
system very complex.
Complexity is what makes software hard to change. That, and
duplication.
Martin Fowler
Software Architecture
• Responsiveness • Security
Does the system return results Does the system protect itself and users’ data
from unauthorized attacks and intrusions?
to users in a reasonable time?
• Usability
• Reliability Can system users access the features that
they need and use them quickly and without
Do the system features errors?
behave as expected by both • Maintainability
developers and users? Can the system be readily updated and new
features added without undue costs?
• Availability • Resilience
Can the system deliver its Can the system continue to deliver user
services when requested by services in the event of partial failure or
external attack?
users?
Why is architecture important?
15
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Architecture in Action: WWW
So is this
16
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Architecture in Action: WWW
And this
17
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
WWW in a (Big) Nutshell
18
WWW in a (Big) Nutshell (cont’d)
19
WWW’s Architecture
20
Context of Software Architecture
Requirements
Design
Implementation
Analysis and Testing
Evolution
Development Process
21
Requirements Analysis
22
New Perspective on Requirements Analysis
23
Non-Functional Properties (NFP)
24
The Twin Peaks Model
25
The Twin Peaks Model
26
Design and Architecture
SOLID
DRY
K.I.S.S
SOLID
Each class has a single responsibility, which makes the code easier to
understand, maintain, and test. The Customer class is responsible for storing
customer information, the Order class is responsible for managing orders, and
the Item class is responsible for storing item information.
• It is not a responsibility of an IPhone class to calculate the
Total sale
• Problem: what if tomorrow I have IPad class, I’ll have to
re-code the same method for that class as well.
What CalculateTotal_Sale()
Exercise
In our UML above as we can see that, we have created IModel interface,
now any class which inherits the IModel must define all of it’s methods in
order to satisfy IS-A relationship else you’ll get compile time error. But your
compiler is not going to be there when you inherit classes rather than
interfaces.
Liskov’s Substitution Principle