Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Software Architecture.

- Mukund
Software Architecture
● Software Architecture defines fundamental organization of a system and more
simply defines a structured solution.
● It defines how components of a software system are assembled, their
relationship and communication between them.
● It serves as a blueprint for software application and development basis for
developer team.
● Software architecture defines a list of things which results in making many
things easier in the software development process.
● A software architecture defines structure of a system.
● A software architecture defines behavior of a system.
● A software architecture defines component relationship.
● A software architecture defines communication structure.
● A software architecture balances stakeholders needs.
● A software architecture influences team structure.
● A software architecture focuses on significant elements.
● A software architecture captures early design decisions.
SOLID principles of Software architecture
Single Responsibility
● The single responsibility
principle states that every
Java class must perform a
single functionality.
● Implementation of multiple
functionalities in a single
class mashup the code and if
any modification is required
may affect the whole class.
● It precise the code and the
code can be easily
maintained.
Open-Closed Principle
● The open-closed principle
states that according to
new requirements the
module should be open for
extension but closed for
modification.
● The extension allows us to
implement new
functionality to the module.
Liskov Substitution Principle
● what the Liskov substitution principle
really says is that when writing an API
relying on polymorphism, you should
first take the point of view of the client of
your API before writing any interface
and any class hierarchy.
Questions that need to be asked.
● Do really all birds can fly? What happen if I try to call Fly() on a bird that cannot fly?
● Is a square really a rectangle? What happen if I change the width on a square?
In the real world this looks like:
● Can all collections really be modified? What happen if I add or remove an element
to an array?
● Do all controls are scrollable? What happen if a scrollbar is displayed on a control
that should not scroll?
● Do withdrawal applies to all bank account? What happen if we try to withdraw
money from a locked long term deposit account? Should we fail withdrawal badly in
this situation or should we prevent such situation with an
IAccountThatAuthorizeWithdraw abstraction?
public abstract class Bird {

public abstract void Fly();

public class Parrot : Bird {

public override void Fly() { throw new NotImplementedException(); } // To implement

public class Ostrich : Bird {

public override void Fly() { throw new NotImplementedException(); } // How to implement this, Ostrih can't fly??

}
public abstract class Bird {

public abstract class FlyingBird : Bird {

public abstract void Fly();

public class Parrot : FlyingBird {

public override void Fly() { throw new NotImplementedException(); }

public class Ostrich : Bird {

}
Interface Segregation Principle
Dependency Inversion Principle
Why use SOLID Principles ?
● It reduces the dependencies so that a block of code can be changed without
affecting the other code blocks.
● The principles intended to make design easier, understandable.
● By using the principles, the system is maintainable, testable, scalable, and
reusable.
● It avoids the bad design of the software.
Advantages of Software Architecture
● Provides a solid foundation for software project.
● Helps in providing increased performance.
● Reduces development cost.
Disadvantages of Software Architecture
● Sometimes getting good tools and standardization becomes a problem for
software architecture.
● Initial prediction of success of project based on architecture is not always
possible.
Thank you !!

You might also like