390 likes | 546 Views
Topic. Architectural Patterns – Adaptable Systems. Pattern Classification. Adaptable Systems. Design for change Open for change Support it’s own modification and extension a priori Core functionality should be resilient to change Adaptation to new standards, hardware platforms.
E N D
Topic Architectural Patterns – Adaptable Systems
Adaptable Systems Design for change Open for change Support it’s own modification and extension a priori Core functionality should be resilient to change Adaptation to new standards, hardware platforms
Architectural Patterns Layers Pipes and Filters Blackboard Mud to Structure Broker Distributed Systems Model-View-Controller Presentation-Abstraction-Control Interactive Systems Microkernel Reflection Adaptable Systems
Adaptable Systems microkernel
Microkernel The Microkernel architectural pattern applies to software systems that must be able to adapt to changing system requirements. It separates minimal core functionality and customer-specific parts. The microkernel also services and a socket for plugging in these extensions and coordinating their collaboration
Microkernel Applies to systems that must be able to adapt to changing system requirements Separates minimal functional core from extended functionality and customer specific parts Serves as a socket for plugging extensions and coordinating their collaboration
Microkernel Client Adapter A conceptual View Only External Servers Internal Servers Microkernel
Participating Components Internal Servers External Servers Adapters Clients Microkernel
Microkernel External Server Microkernel Internal Server calls activates receiveRequest dispatchRequest executeService executeMechnism initCommunication findReceiver createHandle sendMessage callInternalServer receiveRequest dispatchRequest executeService Intialises communication Adapter Client callService createRequest doTask Sends request calls service
Microkernel Class Microkernel • Collaborators • Internal Server • Responsibility • Provides core mechanisms • Offers communication facilities • Encapsulates system dependencies • Manages and Controls resources • Main component of the pattern • Provides core mechanisms • Encapsulates system specific dependencies • Hardware-dependent parts • Maintain system resources • Processes • Files • Goal is to reduce memory requirement • Provide mechanisms which execute quickly
Internal Server Class Internal Server • Collaborators • Microkernel • Responsibility • Implements additional services • Encapsulates some system specifics • Also known as subsystem • Extends functionality provided by Microkernel • Microkernel invokes services based on client requests • Encapsulate some system dependencies • Device drivers • Consider as extensions which are accessible to microkernel only
External Server Class External Server • Collaborators • Microkernel • Responsibility • Provides programming interfaces for its clients Also known as personality Implements it’s own ‘view’ of the underlying microkernel Different servers implement different policies for specific application domains Receives service requests from client applications using the communication facilities provided by the microkernel, interprets these requests, executes the appropriate services and returns results to the clients
Adapter Class Adapter • Collaborators • External Server • Microkernel • Responsibility • Hides system dependencies such as communication facilities from the client • Invokes methods of external servers on behalf of clients Protect the client from implementation details of the microkernel Uses communication mechanism provided by the microkernel Service requests from client from an external server, adapter forwards the call to the appropriate server
Client Class Client • Collaborators • Adapter • Responsibility • Represents an application Application that is associated with exactly one external server (thru adapter) Accesses programming interfaces provided by the external server (thru adapter as a service request)
Other Dynamic Scenarios Develop the message sequence charts for such scenarios. Internal Server Request System initialisation System exit. Sequence of deletion or destruction of objects …
1: Analyse the application domain Perform a domain analysis and the policies the external servers need to offer
2: Analyse the external servers • Analyse the policies the external servers are going to provide • Identify the functionality required in the application domain • Analysis results in • Programming interfaces required to be provided • List of services and service categories necessary
3: Categorise the servers Group all functionality into semantically-independent categories Build categories which are not directly related to application domain Focus is to build the system infrastructure
4:Partition the categories Separate the categories of services Typically based on frequency of use or hardware dependent will be part of microkernel Page fault handlers, drivers and file system form part of internal servers
5:Find a set of operations & abstractions • Find a consistent and complete set of operations and abstractions • Microkernel provides mechanisms for the policies of external server; each policy is implemented thru use of services the microkernel offers • Example • Creating and terminating processes and threads
6:Determine strategies for request transmission and retrieval • Specify the facilities that microkernel should provide for communication between components • Synchronous/Asynchronous • Relationship: one-to-one, many-to-one or a many-to-many • Build core services of message passing or shared memory, based on which the other services can be built
7:Structure the microkernel component Separate system-specific parts from system-independent parts Typical structure is “Layer” Lowermost – system specific Uppermost – system independent; focusing on the services which microkernel will expose
8:Specify the programming interfaces for the microkernel • Decide how the interfaces should be available externally • Microkernel as a • Separate process • Module physically shared by other components • Look for efficiency and not make microkernel a bottle neck
9:Microkernel is responsible for all the system resources Microkernel must implement strategies for sharing, locking, allocation and deallocation of resources Maintain the information about resources and allow access to them in a coordinated and systematic way
10:Design & Implement Internal Servers • Separate processes or shared libraries • Active servers are implemented as processes • Passive servers are implemented as shared libraries • Graphics card driver shared libraries • Page fault handler separate processes
11:Implement the external servers Each external server is implemented as a separate process that provides it’s own service interface Internal architecture depends on the policies it comprises Specify how external servers dispatch requests to their internal procedures
12:Implement the adapters Decide on strategy of adapter; one adapter for all clients or every client associated with one adapter (trade off) Adapter needs to package all relevant information into a request and forwards the request to appropriate external server Acts as a “Proxy”
13:Develop client applications Create a new one or use an existing one When creating new client for a specific external server, its architecture is only limited by the constraints imposed by the external server
Variants Microkernel system with indirect Client-Server connections Distributed Microkernel System Many more variants and interpretations of Microkernel (Look for published papers on ACM and IEEE for conferences)
Benefits Portability Flexibility and Extensibility Separation of policy and mechanism Scalability Reliability Transparency
Liabilities Performance Complexity of design and implementation
Known Uses Mach operating System Amoeba operating System Chorus Windows NT Symbian Find (at least 2) more popular uses and document them Conceptual Architecture of the Linux Kernel http://docs.huihoo.com/linux/kernel/a1/index.html
Microkernel Quick Reference Class Client Class Adapter Class External Server Class Internal Server Class Microkernel • Collaborators • External Server • Microkernel • Collaborators • Microkernel • Collaborators • Microkernel • Collaborators • Internal Server • Collaborators • Adapter External Server Microkernel Internal Server calls activates • Responsibility • Implements additional services • Encapsulates some system specifics • Responsibility • Represents an application • Responsibility • Provides core mechanisms • Offers communication facilities • Encapsulates system dependencies • Manages and Controls resources • Responsibility • Hides system dependencies such as communication facilities from the client • Invokes methods of external servers on behalf of clients • Responsibility • Provides programming interfaces for its clients receiveRequest dispatchRequest executeService executeMechnism initCommunication findReceiver createHandle sendMessage callInternalServer receiveRequest dispatchRequest executeService Intialises communication Adapter Client callService createRequest doTask Sends request calls service