View => Presentation Model (PM) => Presenter (P)
PM/P => Event
Event => Command => Remote Object (RO)
Presentation Model
It contains all the data needed by the view
Each view has an associated PM, and the view binds directly to the data exposed by its PM
Presenter
The Presenter acts upon the Model and the View. It retrieves data from
repositories, persists it, manipulates it, and determines how it will be
displayed in the View.
======================================================================
Presenter (MVP)
Introduction to MVP for Flex (Presenter)
http://www.mxml.it/index.php/2008/09/09/introduction-to-mvp-for-flex/
Presentation Model
Cairngorm and the Presentation Model - Part 1 : Introduction
http://www.dehats.com/drupal/?q=node/48
Cairngorm and the Presentation Model - Part 2 : Sample application
http://www.dehats.com/drupal/?q=node/49
Cairngorm and the Presentation Model - Part 3 : Further thoughts
http://www.dehats.com/drupal/?q=node/50
PM + P
Micro-architectures of Enterpise Applications applied in Flex
http://corlan.org/bootcamp/MicroArchitecture2.pdf
Applying the Presentation Model in Flex
http://blogs.adobe.com/tomsugden/2009/08/applying_the_presentation_mode.html
Showing posts with label Design Pattern. Show all posts
Showing posts with label Design Pattern. Show all posts
-Presentation Model and Presenter
-Cocoa Design Patterns
-Design Pattern Examples in C#
-OODesign - Design Pattern 7 (Structural Patterns)
-OODesign - Design Pattern 6 (Structural Patterns)
-OODesign - Design Pattern 5 (Behavioral Patterns)
-OODesign - Design Pattern 4 (Behavioral Patterns)
-OODesign - Design Pattern 4 (Behavioral pattern)
-OODesign - Design Pattern 3 (Creational pattern)
-OODesign - Design Pattern 2 (Pattern Types)
-OODesign - Design Pattern 1 (Principles)
-Java Practices
-Code Refactoring and Coupling
-Pattern
Tuesday, May 22, 2012
Wednesday, November 23, 2011
Tuesday, November 22, 2011
OODesign - Design Pattern 7 (Structural Patterns)
Ref: http://www.oodesign.com/design-principles.html
Decorator Pattern
> The intent of this pattern is to add additional responsibilities dynamically to an object.
(ref: http://www.oodesign.com/decorator-pattern-gui-example-java-sourcecode.html)

Flyweight Pattern
> The intent of this pattern is to use sharing to support a large number of objects that have part of their internal state in common where the other part of state can vary.
Proxy Pattern
> The intent of this pattern is to provide a "Placeholder" for an object to control references to it.
Decorator Pattern
> The intent of this pattern is to add additional responsibilities dynamically to an object.
(ref: http://www.oodesign.com/decorator-pattern-gui-example-java-sourcecode.html)
Flyweight Pattern
> The intent of this pattern is to use sharing to support a large number of objects that have part of their internal state in common where the other part of state can vary.
Proxy Pattern
> The intent of this pattern is to provide a "Placeholder" for an object to control references to it.
Monday, November 21, 2011
OODesign - Design Pattern 6 (Structural Patterns)
Ref: http://www.oodesign.com/design-principles.html
Adapter Pattern
> Convert the interface of a class into another interface clients expect.
> Adapter lets classes work together, that could not otherwise because of incompatible interfaces.
(example: HA7Adaptor (from HA7 Study/Series/Image/Annotation -> PatientVO/SeriesVO/ImageVO/AnnotationVO)
(example: HL7Adat0r (convert HL7 Object to XML and other format)

Bridge Pattern
> The intent of this pattern is to decouple abstraction from implementation so that the two can vary independently.
(ref: GoF Design Pattern)
(ref: wiki)
Composite Pattern
> The intent of this pattern is to compose objects into tree structures to represent part-whole hierarchies.
> Composite lets clients treat individual objects and compositions of objects uniformly.
(example:
DrawingTool (Component)
FreeHand (Composite)
ControlPoint (leaf)
AddFreeHandCommand (client) )
Adapter Pattern
> Convert the interface of a class into another interface clients expect.
> Adapter lets classes work together, that could not otherwise because of incompatible interfaces.
(example: HA7Adaptor (from HA7 Study/Series/Image/Annotation -> PatientVO/SeriesVO/ImageVO/AnnotationVO)
(example: HL7Adat0r (convert HL7 Object to XML and other format)
Bridge Pattern
> The intent of this pattern is to decouple abstraction from implementation so that the two can vary independently.
(ref: GoF Design Pattern)
(ref: wiki)
Composite Pattern
> The intent of this pattern is to compose objects into tree structures to represent part-whole hierarchies.
> Composite lets clients treat individual objects and compositions of objects uniformly.
(example:
DrawingTool (Component)
FreeHand (Composite)
ControlPoint (leaf)
AddFreeHandCommand (client) )
Sunday, November 20, 2011
OODesign - Design Pattern 5 (Behavioral Patterns)
Ref: http://www.oodesign.com/design-principles.html
Template Method
> Define the skeleton of an algorithm in an operation, deferring some steps to subclasses.
> Template Method lets subclasses redefine certain steps of an algorithm without letting them to change the algorithm's structure.

Visitor Pattern
> Represents an operation to be performed on the elements of an object structure.
> Visitor lets you define a new operation without changing the classes of the elements on which it operates.

Null Object Pattern
> Provide an object as a surrogate for the lack of an object of a given type.
> The Null Object Pattern provides intelligent do nothing behavior, hiding the details from its collaborators.
Template Method
> Define the skeleton of an algorithm in an operation, deferring some steps to subclasses.
> Template Method lets subclasses redefine certain steps of an algorithm without letting them to change the algorithm's structure.
Visitor Pattern
> Represents an operation to be performed on the elements of an object structure.
> Visitor lets you define a new operation without changing the classes of the elements on which it operates.
Null Object Pattern
> Provide an object as a surrogate for the lack of an object of a given type.
> The Null Object Pattern provides intelligent do nothing behavior, hiding the details from its collaborators.
OODesign - Design Pattern 4 (Behavioral Patterns)
Ref: http://www.oodesign.com/design-principles.html
Mediator Pattern
> Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
(example: ...)

Memento Pattern
> The intent of this pattern is to capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.
(example: ManipulationImpl.as)
'
Observer Pattern
> Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
(example: Observe.as) (ref: http://opensource.adobe.com/wiki/display/cairngorm/HowToUseCairngormObserver, http://jacwright.com/373/as3-property-observer-implementation/)

Strategy
> Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Mediator Pattern
> Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
(example: ...)
Memento Pattern
> The intent of this pattern is to capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.
(example: ManipulationImpl.as)
Observer Pattern
> Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
(example: Observe.as) (ref: http://opensource.adobe.com/wiki/display/cairngorm/HowToUseCairngormObserver, http://jacwright.com/373/as3-property-observer-implementation/)
Strategy
> Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Thursday, November 17, 2011
OODesign - Design Pattern 4 (Behavioral pattern)
Ref: http://www.oodesign.com/design-principles.html
Chain of Responsibility
> It avoids attaching the sender of a request to its receiver, giving this way other objects the possibility of handling the request too.
> The objects become parts of a chain and the request is sent from one object to another across the chain until one of the objects will handle it.

Command Pattern
> encapsulate a request in an object
> allows the parameterization of clients with different requests
> allows saving the requests in a queue
(example: Cairngorm Command)
Interpreter
> Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
> Map a domain to a language, the language to a grammar, and the grammar to a hierarchical object-oriented design
(rarely use)

Iterator
> Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Chain of Responsibility
> It avoids attaching the sender of a request to its receiver, giving this way other objects the possibility of handling the request too.
> The objects become parts of a chain and the request is sent from one object to another across the chain until one of the objects will handle it.
Command Pattern
> encapsulate a request in an object
> allows the parameterization of clients with different requests
> allows saving the requests in a queue
(example: Cairngorm Command)
Interpreter
> Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
> Map a domain to a language, the language to a grammar, and the grammar to a hierarchical object-oriented design
(rarely use)
Iterator
> Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
var arr:Array = [1, 2, 3];
var it:Iterator = new ArrayIterator( arr );
while ( it.hasNext() ) {
trace( it.next() ); // 1, 2, 3
}
Saturday, November 12, 2011
OODesign - Design Pattern 3 (Creational pattern)
Ref: http://www.oodesign.com/design-principles.html
Singleton Pattern [easy]
> Ensure that only one instance of a class is created.
> Provide a global point of access to the object.
(example: Cairngorm's Model Locator)

Factory Pattern[easy]
> creates objects without exposing the instantiation logic to the client.
> refers to the newly created object through a common interface
(example: drawingCanvas.mxml, creation of drawingTool)

Factory Method Pattern
> Defines an interface for creating objects, but let subclasses to decide which class to instantiate
> Refers to the newly created object through a common interface
(AbstractDrawingTool(abstract); TextTool, LineTool(concrete Product); redraw(), set Text() (factory method))

Abstract Factory
> Abstract Factory offers the interface for creating a family of related objects, without explicitly specifying their classes.

Builder Pattern [easy]
> Defines an instance for creating an object but letting subclasses decide which class to instantiate
> Refers to the newly created object through a common interface

Prototype Pattern [easy]
> specifying the kind of objects to create using a prototypical instance
> creating new objects by copying this prototype
Object Pool [easy]
> reuse and share objects that are expensive to create
(example: connection pool)
.
Singleton Pattern [easy]
> Ensure that only one instance of a class is created.
> Provide a global point of access to the object.
(example: Cairngorm's Model Locator)
Factory Pattern[easy]
> creates objects without exposing the instantiation logic to the client.
> refers to the newly created object through a common interface
(example: drawingCanvas.mxml, creation of drawingTool)
Factory Method Pattern
> Defines an interface for creating objects, but let subclasses to decide which class to instantiate
> Refers to the newly created object through a common interface
(AbstractDrawingTool(abstract); TextTool, LineTool(concrete Product); redraw(), set Text() (factory method))
Abstract Factory
> Abstract Factory offers the interface for creating a family of related objects, without explicitly specifying their classes.
Builder Pattern [easy]
> Defines an instance for creating an object but letting subclasses decide which class to instantiate
> Refers to the newly created object through a common interface
Prototype Pattern [easy]
> specifying the kind of objects to create using a prototypical instance
> creating new objects by copying this prototype
Object Pool [easy]
> reuse and share objects that are expensive to create
(example: connection pool)
.
OODesign - Design Pattern 2 (Pattern Types)
Ref: Wikipedia
1. Creational pattern
are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation
2. Behavioral pattern
identify common communication patterns between objects and realize these patterns
3. Structural pattern
ease the design by identifying a simple way to realize relationships between entities.
1. Creational pattern
are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation
2. Behavioral pattern
identify common communication patterns between objects and realize these patterns
3. Structural pattern
ease the design by identifying a simple way to realize relationships between entities.
OODesign - Design Pattern 1 (Principles)
Ref: http://www.oodesign.com/design-principles.html
Principles:
3 important characteristics of a bad design that should be avoided
1. Rigidity
2. Fragility
3. Immobility
Open Close Principle
classes, modules and functions should be open for extension but closed for modifications
Dependency Inversion Principle
High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
Interface Segregation Principle
Clients should not be forced to depend upon interfaces that they don't use.
Single Responsibility Principle
A class should have only one reason to change.
Liskov's Substitution Principle
Derived types must be completely substitutable for their base types.
Principles:
3 important characteristics of a bad design that should be avoided
1. Rigidity
2. Fragility
3. Immobility
Open Close Principle
classes, modules and functions should be open for extension but closed for modifications
Dependency Inversion Principle
High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
Interface Segregation Principle
Clients should not be forced to depend upon interfaces that they don't use.
Single Responsibility Principle
A class should have only one reason to change.
Liskov's Substitution Principle
Derived types must be completely substitutable for their base types.
Wednesday, April 20, 2011
Sunday, March 20, 2011
Code Refactoring and Coupling
Code Refactoring
http://en.wikipedia.org/wiki/Code_refactoring
Coupling
http://en.wikipedia.org/wiki/Coupling_%28computer_programming%29
Dependency Hell
http://en.wikipedia.org/wiki/Dependency_hell
Refactoring To Patterns
http://rockfish.cs.unc.edu/COMP290-agile/rtp113.pdf
http://en.wikipedia.org/wiki/Code_refactoring
Coupling
http://en.wikipedia.org/wiki/Coupling_%28computer_programming%29
Dependency Hell
http://en.wikipedia.org/wiki/Dependency_hell
Refactoring To Patterns
http://rockfish.cs.unc.edu/COMP290-agile/rtp113.pdf
Saturday, March 19, 2011
Pattern
Patterns enable us to document a known recurring problem and its solution in a particular
context, and to communicate this knowledge to others.
• Presentation tier
• Business tier
• Integration tier
Presentation tier
Intercepting Filter (144)
Front Controller (166)
Context Object (181)
Application Controller (205)
View Helper (240)
Composite View (262)
Service to Worker (276)
Dispatcher View (288)
Business tier
Business Delegate (302)
Service Locator (315)
Session Façade (341)
Application Service (357)
Business Object (374)
Composite Entity (391)
Transfer Object (415)
Transfer Object Assembler (433)
Value List Handler (444)
Integration tier
Data Access Object (462)
Service Activator (496)
Domain Store (516)
Web Service Broker (557)
Chapter 1: Introduction
Chapter 2: Presentation Tier Design Considerations and Bad Practices
Chapter 3: Business Tier Design Considerations and Bad Practices
Chapter 4: J2EE Refactorings
Chapter 5: J2EE Patterns Overview
Chapter 6: Presentation Tier Patterns
Chapter 7: Business Tier Patterns
Chapter 8: Integration Tier Patterns
context, and to communicate this knowledge to others.
• Presentation tier
• Business tier
• Integration tier
Presentation tier
Intercepting Filter (144)
Front Controller (166)
Context Object (181)
Application Controller (205)
View Helper (240)
Composite View (262)
Service to Worker (276)
Dispatcher View (288)
Business tier
Business Delegate (302)
Service Locator (315)
Session Façade (341)
Application Service (357)
Business Object (374)
Composite Entity (391)
Transfer Object (415)
Transfer Object Assembler (433)
Value List Handler (444)
Integration tier
Data Access Object (462)
Service Activator (496)
Domain Store (516)
Web Service Broker (557)
Chapter 1: Introduction
Chapter 2: Presentation Tier Design Considerations and Bad Practices
Chapter 3: Business Tier Design Considerations and Bad Practices
Chapter 4: J2EE Refactorings
Chapter 5: J2EE Patterns Overview
Chapter 6: Presentation Tier Patterns
Chapter 7: Business Tier Patterns
Chapter 8: Integration Tier Patterns
Subscribe to:
Posts (Atom)