Layered Style Examples

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Lecture 23: Software Architectures
Event Based Implicit Invocation By Ajay Mansata. INTRODUCTION An Architectural style defines a family of systems. An Architectural style defines a family.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
The Design Discipline.
MVC and MVP. References enter.html enter.html
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
An Introduction to Software Architecture
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 07. Review Architectural Representation – Using UML – Using ADL.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Architectural Styles.
CHAPTER TEN AUTHORING.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Architectural Design Identifying system components and their interfaces.
Systems Analysis and Design in a Changing World, 3rd Edition
Model View Controller MVC Web Software Architecture.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 system architecture 1 after designing to meet functional requirements, design the system.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Lecture VIII: Software Architecture
Distributed Systems Architectures Chapter 12. Objectives  To explain the advantages and disadvantages of different distributed systems architectures.
Software Reuse. Objectives l To explain the benefits of software reuse and some reuse problems l To discuss several different ways to implement software.
Distributed Systems Architectures. Topics covered l Client-server architectures l Distributed object architectures l Inter-organisational computing.
Computer System Structures
Imposing MVC design sample in.NET. Design patterns are very useful to solve complex design issues if used well. The primary concept of the Model View.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
7. Modular and structured design
CompSci 280 S Introduction to Software Development
Software architecture
Kernel Design & Implementation
CS 325: Software Engineering
N-Tier Architecture.
The Development Process of Web Applications
IS301 – Software Engineering Dept of Computer Information Systems
Observer Design Pattern
Observer Design Pattern
MVC and other n-tier Architectures
Event driven architectures
Operating System Structure
Part 3 Design What does design mean in different fields?
CSC 480 Software Engineering
Software Quality Engineering
Introduction to Operating System (OS)
#01 Client/Server Computing
Software Testing and Maintenance Designing for Change
Interpreter Style Examples
Informatics 43 – May 26, 2016.
Model-View-Controller Patterns and Frameworks
Princess Nourah bint Abdulrahman University
Software Architecture
Architectural Design.
Starting Design: Logical Architecture and UML Package Diagrams
Software models - Software Architecture Design Patterns
Analysis models and design models
Software Design Lecture : 8
Operating Systems : Overview
An Introduction to Software Architecture
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Operating Systems : Overview
Operating Systems : Overview
OS Components and Structure
Operating Systems : Overview
Design Yaodong Bi.
#01 Client/Server Computing
Software Testing and Maintenance Designing for Change
Presentation transcript:

Layered Style Examples Layered Communication Protocols: Each layer provides a substrate for communication at some level of abstraction. Lower levels define lower levels of interaction, the lowest level being hardware connections (physical layer). Operating Systems Unix (c) Ian Davis Spring 2017

Unix Layered Architecture (c) Ian Davis Spring 2017

Overlaid Layered Architecture Dynamically load code as needed Can instantiate many different capabilities at run time Free memory for reuse when no longer needed COBOL (Initial, mainline, final) COM/OLE Reference counting Garbage collection Spring 2017 (c) Ian Davis

Pattern: Microkernel Context Problem Forces Core functionality must deploy on different platforms Problem Connections to hardware / OS subject to change Forces Preserve abstraction rather than focus on detail Encapsulate what may change so easier to change Share abstraction across all applications Memory protection within O/S as well as outside Spring 2017 (c) Ian Davis

Characteristics Minimal capabilities in a much reduced Kernel Process creation / deletion / scheduling Foundational Inter-Process Communication Secure Memory Management Much implemented as application software File System / Network Software / Drivers Offers choice / variety / extension / change Adaptable (O/S not set in stone) Spring 2017 (c) Ian Davis

Spring 2017 (c) Ian Davis

https://en.wikipedia.org/wiki/Microkernel Spring 2017 (c) Ian Davis

Layered Style Advantages Design: based on increasing levels of abstraction. Enhancement: since changes to the function of one layer affects at most two other layers. Reuse: since different implementations (with identical interfaces) of the same layer can be used interchangeably. (c) Ian Davis Spring 2017

Layered Style Disadvantages Not all systems are easily structured in a layered fashion. Performance requirements may force the coupling of high-level functions to their lower-level implementations. Adding layers increases the risk of error. Eg. getchar() doesn’t work correctly on Linux if the code is interrupted, but read() does. (c) Ian Davis Spring 2017

Object-Oriented Style Powerful metaphor Dynamic creation and deletion of objects Clearer encapsulation of functionality More restrictions on legitimate usage Inheritance Polymorphism Pure abstract interfaces Spring 2017 (c) Ian Davis

Implicit Invocation Architecture Spring 2017 (c) Ian Davis

Implicit Invocation Model/View/Controller Publish/Subscriber Data forms the Model Controller changes the model Controller announces to requesting views change Publish/Subscriber Publishes to topics Subscribers listen to topics Observer design pattern Underlying implementation Spring 2017 (c) Ian Davis

Pattern: Model View Controller Context Systems retrieve and display data in many formats User interface may need new or altered views Problem Don’t want core application to be concerned with supporting the User Interface behaviour Forces at work User interface expected to evolve Parallel tasks can be handled in different ways Partition how things appear from how they change Spring 2017 (c) Ian Davis

Model View Controller (MVC) Spring 2017 (c) Ian Davis

Model ↔ View ↔ Controller Business logic does not sit between Display and State Changes to model broadcast to listeners View responsible for presentation of model Different parts of dashboard all listen for change Controller Responsible for handling input Maintains model consistency Spring 2017 (c) Ian Davis

Model View Presenter Problem Solution Hard to test/generate pseudo user interaction Solution Separate the logic for the visual display View (software that writes to the screen) Presenter (sees interactions that occur on screen) Impose a strict interface between the two Can now test presenter without having a screen Simply invoke interface from test software Spring 2017 (c) Ian Davis

MVC .v. MVP MVP can be a refinement of MVC Android MVP looks a lot more like 3 tier The presenter is the middle-man between model and view. All your business logic belongs to it. The presenter is responsible for querying the model and updating the view, reacting to user interactions updating the model. https://medium.com/@cervonefrancesco/model-view-presenter-android-guidelines-94970b430ddf Spring 2017 (c) Ian Davis

Why to avoid 3-tier In a dashboard can have many sub-views New sub-views should be easy to develop A sub-view may not be visible all the time Putting all view management in the presenter makes the presenter ever fatter (and confused) Risks breaking presenter if have to change it Presenter doesn’t care about the views subview listening software better encapsulated subview can easily be deactivated/reactivated Spring 2017 (c) Ian Davis

Implicit Invocation Style Suitable for applications that involve loosely-coupled collection of components, each of which carries out some operation and may in the process enable other operations. A generalization of event driven code in which relevant state is included with the event, and multiple processes can “see” events. (c) Ian Davis Spring 2017

Implicit Invocation Style (Cont’d) Instead of invoking a procedure directly ... A component can announce (or broadcast) one or more events. Other components in the system can register an interest in an event by associating a procedure with the event. When an event is announced, the broadcasting system (connector) itself invokes all of the procedures that have been registered for the event. (c) Ian Davis Spring 2017

Implicit Invocation Style (Cont’d) 11/30/2018 Implicit Invocation Style (Cont’d) An event announcement “implicitly” causes the invocation of procedures in other modules. (c) Ian Davis Spring 2017

Implicit Invocation Invariants Announcers of events do not know which components will be affected by those events. Components cannot make assumptions about what processing will occur as a result of their events (perhaps no component will respond). Components cannot make assumptions about the order of processing. (c) Ian Davis Spring 2017

Implicit Invocation Specializations Often connectors in an implicit invocation system also include the traditional procedure call in addition to the bindings between event announcements and procedure calls. (c) Ian Davis Spring 2017

Implicit Invocation Examples Used in programming environments to integrate tools: Debugger stops at a breakpoint and makes that announcement. Editor responds to the announcement by scrolling to the appropriate source line of the program and highlighting that line. LSEdit (c) Ian Davis Spring 2017

Implicit Invocation Examples (Cont’d) Used to enforce integrity constraints in database management systems (called triggers). Used in user interfaces to separate the presentation of data (views) from the applications that manage that data. Used in user interfaces to allow correct mapping of function keys etc. to logic. Used in forms to allow generic logic. (c) Ian Davis Spring 2017

Implicit Invocation Advantages Provides strong support for reuse since any component can be introduced into a system simply by registering it for the events of that system. Eases system evolution since components may be replaced by other components without affecting the interfaces of other components in the system. Easy to add new views, etc. (c) Ian Davis Spring 2017

Implicit Invocation Advantages Eases system development since one has to only map the events which occur to the software that manages them, and these events are often predefined. Case tools hide the complexities of managing the flow of events. Asynchronous interface improves performance, response times etc. Parallelism? (c) Ian Davis Spring 2017

Implicit Invocation Disadvantages When a component announces an event: it has no idea what other components will respond to it, it cannot rely on the order in which the responses are invoked, it cannot know when responses are finished. Feedback involves generating additional events that are routed to callback routines. (c) Ian Davis Spring 2017

Implicit Invocation Disadvantages There is no single defined flow of logic within such systems. It can be hard to consider all possible events that may occur, and their interactions. Such systems can be very hard to both maintain and debug. There is the risk that you end up communicating with “Trojan horses”. (c) Ian Davis Spring 2017