Presentation is loading. Please wait.

Presentation is loading. Please wait.

Architectural Styles. ContentContent Data Flow Styles – Batch Sequential – Pipe and Filter Implicit Invocation – Event Based – Publish Subscribe Layered.

Similar presentations


Presentation on theme: "Architectural Styles. ContentContent Data Flow Styles – Batch Sequential – Pipe and Filter Implicit Invocation – Event Based – Publish Subscribe Layered."— Presentation transcript:

1 Architectural Styles

2 ContentContent Data Flow Styles – Batch Sequential – Pipe and Filter Implicit Invocation – Event Based – Publish Subscribe Layered – Virtual machines – Client Server Repositories – Repository – Backboard Shared State – Backboard – Rule Based/Expert Systems Interpreter – Interpreter – Mobile Code Process Control

3 Data-Flow Styles Batch Sequential – Separate programs are executed in order; data is passed as an aggregate from one program to the next. – Connectors: “The human hand” carrying tapes between the programs, a.k.a. “sneaker-net ” – Data Elements: Explicit, aggregate elements passed from one component to the next upon completion of the producing program’s execution. Typical uses: Transaction processing in financial systems. “The Granddaddy of Styles” 3

4 Batch-Sequential: A Financial Application 4

5 Batch-Sequential LL 5 Not a recipe for a successful lunar mission!

6 Pipe and Filter Style Components are filters – Transform input data streams into output data streams – Possibly incremental production of output Connectors are pipes – Conduits for data streams Style invariants – Filters are independent (no shared state) – Filter has no knowledge of up- or down-stream filters Examples – UNIX shell – Distributed systems signal processing parallel programming Example: ls invoices | grep -e August | sort 6

7 Pipe and Filter (cont’d) Variations – Pipelines — linear sequences of filters – Bounded pipes — limited amount of data on a pipe – Typed pipes — data strongly typed Advantages – System behavior is a succession of component behaviors – Filter addition, replacement, and reuse Possible to hook any two filters together – Certain analyses Throughput, latency, deadlock – Concurrent execution 7

8 Pipe and Filter (cont’d) Disadvantages – Batch organization of processing – Interactive applications – Lowest common denominator on data transmission 8

9 Pipe and Filter LL 9

10 Implicit Invocation Style Event announcement instead of method invocation – “Listeners” register interest in and associate methods with events – System invokes all registered methods implicitly Component interfaces are methods and events Two types of connectors – Invocation is either explicit or implicit in response to events Style invariants – “Announcers” are unaware of their events’ effects – No assumption about processing in response to events 1010

11 Implicit Invocation (cont’d) Advantages – Component reuse – System evolution Both at system construction-time & run-time Disadvantages – Counter-intuitive system structure – Components relinquish computation control to the system – No knowledge of what components will respond to event – No knowledge of order of responses 1

12 Publish-Subscribe Subscribers register/deregister to receive specific messages or specific content. Publishers broadcast messages to subscribers either synchronously or asynchronously. 1212

13 Publish-Subscribe (cont’d) Components: Publishers, subscribers, proxies for managing distribution Connectors: Typically a network protocol is required. Content- based subscription requires sophisticated connectors. Data Elements: Subscriptions, notifications, published information Topology: Subscribers connect to publishers either directly or may receive notifications via a network protocol from intermediaries Qualities yielded Highly efficient one-way dissemination of information with very low-coupling of components 1313

14 Pub-Sub LL 1414

15 Event-Based Style Independent components asynchronously emit and receive events communicated over event buses Components: Independent, concurrent event generators and/or consumers Connectors: Event buses (at least one) Data Elements: Events – data sent as a first-class entity over the event bus Topology: Components communicate with the event buses, not directly to each other. Variants: Component communication with the event bus may either be push or pull based. Highly scalable, easy to evolve, effective for highly distributed applications. 1515

16 Event-based LL 1616

17 Quiz A bank application that sends SMS to clients to their registered mobile phones when account gets credited or debited A multiplayer lunar lander gaming application An application in the operating system that will backup data at the end of every logout An application to convert the data in legacy systems and update into the NoSql Data base.

18 Quiz A bank application that sends SMS to clients to their registered mobile phones when account gets credited or debited – Publisher /Subscriber A multiplayer lunar lander gaming application – Event Based An application in the operating system that will backup data at the end of every logout – Pipe and filter An application to convert the data in legacy systems and update into the NoSql Data base. – Batch Processing

19 Layered Style Hierarchical system organization – “Multi-level client-server” – Each layer exposes an interface (API) to be used by above layers Each layer acts as a – Server: service provider to layers “above” – Client: service consumer of layer(s) “below” Connectors are protocols of layer interaction Example: operating systems Virtual machine style results from fully opaque layers 1919

20 Layered Style (cont’d) Advantages – Increasing abstraction levels – Evolvability – Changes in a layer affect at most the adjacent two layers Reuse – Different implementations of layer are allowed as long as interface is preserved – Standardized layer interfaces for libraries and frameworks 2020

21 Layered Style (cont’d) Disadvantages – Not universally applicable – Performance Layers may have to be skipped – Determining the correct abstraction level 2121

22 Operating Systems

23 Layered LL 2323

24 Virtual Machines A virtual machine implements an instruction set for an imaginary machine Often virtual machines are the underlaying mechanism by which a programming language is executed E.g. Java virtual machine, different interpreters Specifies an interface between compiler and a real machine From conceptual point of view very similar to OS Improves portability

25 Layered Systems/Virtual Machines 2525

26 Client-Server Style Components are clients and servers Servers do not know number or identities of clients Clients know server’s identity Connectors are RPC-based network interaction protocols 2626

27 Client Server LL

28 Data Centered Architectural Style These architectures have the goal of achieving the quality ofdata integrity The term refers to systems in which the access and update of a widely accessed data store is their primary goal Basically, it is nothing more than a centralized data store that communicates with a number of clients

29 Data Centered Architectural Style The means of communication distinguishes the two subtypes: repository and blackboard Repository: a client sends a request to the system to perform a necessary action (e.g. insert data) Blackboard: the system sends notification and data to subscribers when data of interest changes, and is thus active

30 Repository Shared data is a passive repository Twokindsof components: – a central data-store carrying the system current state, and – a set of independent componentsthat perform operations on the data carried by the central data-store

31 Blackboard Variant of the repository style used for systems involving complex problem solving (e.g. signal processing, programming environments) Provide a high-level organization and control of the knowledge needed for complex problem solving Context: An immature domain in which no closed approach to a solution is known or feasible. Known Uses: – -Speech recognition – -Enemy detection – -Object monitoring – -Expert systems A collection of independent programs that work cooperatively on a common data structure - “Opportunistic problem solving”

32 Blackboard (cntd) ofcomponents sources: specific piecesofknowledgepiecesofknowledge Threekinds involved: – Knowledge application (e.g. data, algorithmsand procedures needed to solve the problem) – The blackboard and its data structure: describe the state of the solution in a global data store – Thecontrolcomponent: triggeredbychangesinthe blackboard activatesthe ;decidesmost;decidesmost and suitable knowledge sources

33 Blackboard LL

34 Shared State Blackboard Rule Based/ Expert System – Knowledge Base : Facts and production rules ( if.. then clauses on a set of variables) – UI : 2 modes, one for entering facts & production rules, other for queries – Inference engine : parses user input and determines whether it is a fact/rule or a query. If it is a fact/rule, it adds this entry to the knowledge base. Otherwise, it queries the knowledge base for applicable rules and attempts to resolve the query

35 Rule Based/Expert System LL

36 Quiz Compiler architecture Integrated Programming Environment Architecture Web-based Authentication system An invoice processing system checks issued invoices against payments received, and accordingly, issues either receipts or payment reminders for customers Model of a Language Processing System Speech Recognition System

37 Quiz Compiler architecture – Pipe and Filter IntegratedProgrammingEnvironment Architecture– Virtual Machine Web-based Authentication system – Event Based Aninvoiceprocessingsystemchecksissued invoices against payments received, and accordingly, issues either receipts or payment reminders for customers – Batch Processing –Rule ModelofaLanguageProcessingSystem Based/Expert System Speech Recognition System - Blackboard

38 Compiler Architecture

39 Interpreter Interpreterparsesandexecutesinputcommands,updating the state maintained by the interpreter Components:Commandinterpreter,program/interpreter state, user interface. Connectors:Typicallyverycloselyboundwithdirect procedure calls and shared state. Highlydynamicbehaviorpossible,wherethesetof commandsisdynamicallymodified.Systemarchitecture mayremainconstantwhilenewcapabilitiesarecreated based upon existing primitives. Superb for end-user programmability; supports dynamically changing set of capabilities Lisp and Scheme

40 Interpreter (cntd) Architecture is based on a virtual machine produced in software Special kind of a layered architecture where a layer is implemented as a true language interpreter Components – “Program” being executed and its data – Interpretation engine and its state Example: Java Virtual Machine – Java code translated to platform independent bytecode – JVM is platform specific and interprets the bytecode

41 Interpreter LL

42 Mobile Code Summary: a data element (some representation of a program) is dynamically transformed into a data processing component. Components: “Execution dock”, which handles receipt of code and state; code compiler/interpreter Connectors: Network protocols and elements for packaging code and data for transmission. Data Elements: Representations of code as data; program state; data Variants: Code-on-demand, remote evaluation, and mobile agent.

43 Mobile Code LL Scripting languages (i.e. JavaScript, VBScript), ActiveX control, embedded Word/Excel macros.

44 Process Control Based on process control loops Control loop designs are characterized both by the components and the relationship among them Organization: – Computational elements (important separation) Process definition. Control algorithm. – Data elements: Process variables. Set point. Control algorithm uses information about actual system state to tune the process, driving the actual state towards the intended state Process variables, controlled variable, input variable, manipulated variable, set point Open loop systems, Closed loop systems, Feedback control, Feed forward

45 Process Control Open Loop Temperature Control SystemClosed Loop Temperature Control System

46 Process Control Strengths / Weakness Strength - Well suited for the control of continuous processes particularly where the control algorithm is subject to change (possibly even at run-time) multiple Weakness-Noteasilyapplicablewhen interacting processes (and controls) are needed Applications – Cruise Control, Heating ht p://nicomiceli.com/tracking-your-home-with-google-analytics/ ht p://jitpl.jmls.edu/2014/01/25/227/


Download ppt "Architectural Styles. ContentContent Data Flow Styles – Batch Sequential – Pipe and Filter Implicit Invocation – Event Based – Publish Subscribe Layered."

Similar presentations


Ads by Google