Presentation on theme: "Software Architecture & Difference from Design"— Presentation transcript:

1 Software Architecture & Difference from Design

Boutique product development company It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products. PPt by: Arslan Anwar | Senior Software Engineer

2

3 Software Architecture

What is Software Architecture Architecture vs. Design Why Architecture is important MVC , MVP , MV VM, 3 Tier

4 What is Software Architecture

5 Software Architecture

What is Software Architecture IEEE: Architecture is defined by the recommended practice as the fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution. Architecture captures system structure in terms of components and how they interact. It primarily focuses on aspects such as performance, reliability, scalability, testability, maintainability and various other attributes, which can be key both structurally and behaviorally of a software system.

6 All architecture is design, but not all design is architecture.

Software Architecture Software Architecture vs. Software Design All architecture is design, but not all design is architecture.

7 Software Architecture vs. Software Design

8 Software Architecture vs. Software Design

Fundamental properties Detailed properties Define guidelines Communicate with developers Cross-cutting concerns Details High-impact Individual components Communicate with business stakeholders Use guidelines Manage uncertainty Avoid uncertainty Conceptual integrity Completeness

9 Role of Software Architecture

Architecture plays a vital role in establishing the structure of the system, early in the development lifecycle

10 Application processing Data management

Software Architecture Multi Tier Architecture In software engineering, multi-tier architecture (often referred to as n-tier architecture) is a client–server architecture in which Presentation Application processing Data management functions are physically separated. The most widespread use of multi-tier architecture is the three-tier architecture.

11 Multitier Tier Architecture

Software Architecture Multitier Tier Architecture

12 1 - * relationship between controller and view

Software Architecture Model View Controller A controller can send commands to the model to update the model's state (e.g., editing a document). It can also send commands to its associated view to change the view's presentation of the model (e.g., by scrolling through a document). A model notifies its associated views and controllers when there has been a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. In some cases an MVC implementation might instead be "passive," so that other components must poll the model for updates rather than being notified. A view requests information from the model that it uses to generate an output representation to the user. 1 - * relationship between controller and view

13 Software Architecture

Model View Controller

14 1 - 1 relationship between presenter and view

Software Architecture Model View Presenter MVP is a user interface architectural pattern engineered to facilitate automated unit testing and improve the separation of concerns in presentation logic: The model is an interface defining the data to be displayed or otherwise acted upon in the user interface. The view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data. The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view. 1 - 1 relationship between presenter and view

15 Software Architecture

Model View Presenter

16 Software Architecture

Model View Adapter Model–view–adapter (MVA) or mediating-controller MVC is an architectural pattern and multitier architecture, used in software engineering. In complex computer applications that present large amounts of data to users, developers often wish to separate data (model) and user interface (view) concerns so that changes to the user interface will not affect data handling and that the data can be reorganized without changing the user interface.

17 Software Architecture

Model View ViewModel Model: domain model which or the data access layer that represents that content View: View refers to all elements displayed by the GUI such as buttons, labels, and other controls. View model: “model of the view” meaning it is an abstraction of the view that also serves in mediating between the view and the model which is the target of the view data bindings. It could be seen as a specialized aspect of what would be a controller (in the MVC pattern) that acts as a converter that changes model information into view information and passes commands from the view into the model. Controller: some references for MVVM also include a controller layer to illustrate that the view model is a specialized functional set in parallel with a controller, while others do not. Binder: the use of a declarative databinding and command bind technology is an implicit part of the pattern. Relationship: Many views can use one ViewModel

18 Software Architecture

Model View ViewModel

19 Design Patterns Thank You

20 Software Design and Principles

Boutique product development company It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products. PPt by: Arslan Anwar | Senior Software Engineer

21 Software Design and Principles

What is Software Design Design Smell Software Design Principles SOLID (object-oriented design) DRY principle YAGNI principle KISS principle

22 What is Software Design

Software design is the process of defining software methods, functions, objects, and the overall structure and interaction of your code so that the resulting functionality will satisfy your users requirements.

23 Rigidity Fragility Immobility Viscosity Needless Complexity

Software Design 7 Design Smell Rigidity Fragility Immobility Viscosity Needless Complexity Needless repetition Opacity

24 Software Design 7 Design Smell Rigidity The system is hard to change because every change forces many other changes to other parts of the system. Fragility Changes cause the system to break in places that have no conceptual relationship to the part that was changed. Immobility It is hard to disentangle the system into components that can be reused in other systems.

25 Doing things right is harder than doing things wrong.

Software Design 7 Design Smell Viscosity Doing things right is harder than doing things wrong. Needless Complexity The design contains infrastructure that adds no direct benefit. Need Repetition The design contains repeating structures that could be unified under a single abstraction. Opacity It is hard to read and understand. It does not express its intent well.

26 Software Design Principles

Software design principles represent a set of guidelines that helps us to avoid having a bad design. The software designs helps to make a software well designed, well read and best maintainable.

27 Single Responsibility Open Closed Liskov Substitution

Software Design Principles S.O.L.I.D Principles S.O.L.I.D. is a collection of best-practice, object-oriented design principles which can be applied to your design, allowing you to accomplish various desirable goals such as loose-coupling, higher maintainability, intuitive location of interesting code, etc. Single Responsibility Open Closed Liskov Substitution Interface Segregation Dependency Inversion

28 Software Design Principles

S.O.L.I.D Principles

29 Single Responsibility Principle

Software Design Principles Single Responsibility Principle

30 Single Responsibility Principle

Software Design Principles Single Responsibility Principle The Single Responsibility Principle (SRP) states that there should never be more than one reason for a class to change. This means that every class, or similar structure, in your code should have only one job to do.

31 Software Design Principles

Open Closed Principle

32 Software Design Principles

Open Closed Principle The Open-Closed Principle (OCP) states that classes should be open for extension but closed for modification. “Open to extension” means that you should design your classes so that new functionality can be added as new requirements are generated. “Closed for modification” means that once you have developed a class you should never modify it, except to correct bugs.

33 So how do we add credit card support? You

Software Design Principles Open Closed Principle So how do we add credit card support? You could add an “if” statement like this, but then that would be violation of OCP. Here is a better solution:

34 Liskov Substitution Principle

Software Design Principles Liskov Substitution Principle

35 "Derived types must be completely substitutable for their base types"

Software Design Principles Liskov Substitution Principle "Derived types must be completely substitutable for their base types"

36 Liskov Substitution Principle

Software Design Principles Liskov Substitution Principle

37 Interface Segregation Principle

Software Design Principles Interface Segregation Principle

38 Interface Segregation Principle

Software Design Principles Interface Segregation Principle The Interface Segregation Principle (ISP) states that clients should not be forced to depend upon interface members they do not use. When we have non-cohesive interfaces, the ISP guides us to create multiple, smaller, cohesive interfaces.

39 Interface Segregation Principle

Software Design Principles Interface Segregation Principle

40 Dependency Inversion Principle

Software Design Principles Dependency Inversion Principle

41 Dependency Inversion Principle

Software Design Principles Dependency Inversion Principle The Dependency Inversion Principle (DIP) states that high-level modules should not depend upon low-level modules; they should depend on abstractions. Secondly, abstractions should not depend upon details; details should depend upon abstractions.

42 Miscellaneous Principles which are worth mentioning

Software Design Principles Miscellaneous Principles which are worth mentioning Program to Interface Not Implementation. Depend on Abstractions, Not Concrete classes. YAGNI (You aren’t going to need it. So don’t implement it). Least Knowledge Principle. (Only talk to your immediate friends. Classes that they inherit from, objects that they contain, objects passed by argument) Hollywood Principle. ( Don’t call use, we will call you ) Keep it Simple and Sweet / Stupid. ( KISS) Minimize Coupling Maximize Cohesion Apply Design Pattern wherever possible.

43 Software Design Principles

Don’t Repeat Yourself

44 Design Patterns Thank You