11-12-2012, 02:44 PM
Architecture and design patterns
Architecture and design patterns.ppt (Size: 445 KB / Downloads: 68)
Lecture Objectives
Open a window to the architecture and design patterns world, explain why are they needed and where did they came from, and give some examples and real world tastes of chosen DP and architectures
not a programming language oriented lecture, we will mainly discuss the paradigms and uses with examples in various programming languages.
Programming paradigms Evolution
Block Programming
Procedural programming
Object Oriented
Component Oriented
SOA (?)
Observer design patterns
Behavioral Pattern
one-to-many dependency model, so that when one object changes state, all its dependents are notified and updated automatically without coupling the notifying object to the objects that are notified.
Example:
Button expose a clicked event that encapsulate click state, thus publish himself as an observable. Clients that are interested in this event register to it, thus becomes observers.
Observer and observable are bonded in a contract and can be completely loosely coupled from one another.
Consumer/Producer
Concurrency Pattern
This design pattern coordinates the concurrent production and consumption of information among producer and consumer objects that are working on different threads.
This pattern is used with some type of semaphore
SOA - Principles
Visibility – the ability for a service consumer to “see” a service provider (Awareness, willingness and Reachability)
Interaction - the activity of using a capability. (usually message exchange - by contracts, constraints and policies, for example Web Service Description Language)
Effect – the result of an interaction
Component Manager and EXE Runner paradigm
Why should the GUI client have the EXE main thread?
Why shouldn’t we have a visual and easy to use interface for configuring and\or adding\removing physical components?
Solution:
Component Manager – drag and drop assemblies and connect functionality using events and delegate signatures, eventually compile an XML file that will represent all assemblies and connections
EXE Runner – Run the XML file with the EXE main thread loading the application assemblies and connecting relations in run-time