banner



J2ee Design Patterns Video Tutorial

Design Patterns:

Patterns are solutions for the specific problem in a specific context. (OR) Patterns are solutions to recurring problem in a specific context.

Java Design Patterns:

Java design patterns can be categories into three types.(examples http://www.go4expert.com/forums/showthread.php?t=5127)

  1. Creational Patterns
  2. Behavioral Patterns
  3. Structural Patterns
  1. Creational Patterns :
    • Factory Design Pattern
    • Abstract Factory Design Pattern
    • Singleton Design Pattern
    • Builder Design Pattern
    • Prototype Design Pattern
  2. Behavioral Patterns :
    • Chain of Responsibility Design Pattern
    • Command Design Pattern
    • Interpreter Design Pattern
    • Iterator Design Pattern
    • Mediator Design Pattern
    • Momento Design Pattern
    • Observer Design Pattern
    • State Design Pattern
    • Strategy Design Pattern
    • Template Design Pattern
    • Visitor Design Pattern
  3. Structural Patterns:
    • Adapter Design Pattern
    • Bridge Design Pattern
    • Composite Design Pattern
    • Decorator Design Pattern
    • Facade Design Pattern
    • Flyweight Design Pattern
    • Proxy Design Pattern

Core design patterns are also called as GOF (Gang of Four).

You can use GOF Patterns in any domain like J2ee domain, . Net domain

, Sap domain etc.

In addition to these GOF Patterns we have some domain specific patterns

When you are developing the application using .Net Patterns Microsoft has provided some patterns which have specific to .Net which are called .Net Patterns.

When we are developing J2ee application Sun has provided some patterns which are specific to J2ee domain etc. like depends on domain.

You can use J2ee domain specific patterns for J2ee application. we can use GOF patterns some times.

J2ee Design Patterns:

J2ee design patterns are divided into the following based on the layer.

  1. Presentation Layer Design Patterns or Presentation Tier
  2. Business Layer Design Patterns or Business Tier
  3. Integration Layer or Integration Tier
  1. Presentation Layer Design Patterns (or) Presentation Tier:
    • Intercepting Filter Design Pattern
    • Context Object Design Pattern
    • Front Controller Design Pattern
    • Application Controller Design Pattern
    • View Helper Design Pattern
    • Composite View Design Pattern
    • Dispatcher View Design Pattern
    • Service To Worker Design Pattern
  2. Business Layer Design Patterns (or) Business Tier:
    • Business Delegate Design Pattern
    • Service Locator Design Pattern
    • Session Façade Design Pattern
    • Application Service Design Pattern
    • Business Object Design Pattern
    • Composite Entity Design Pattern
    • Transfer Object Design Pattern
    • T O Assembler Design Pattern
    • Value List Handler Design Pattern
  3. Integration Layer (or) Integration Tier:
    • Data Access Object Design Pattern
    • Service Activator Design Pattern
    • Domain Store Design Pattern
    • Web Service Broker Design Pattern

4.31. What is Gang of Four (GoF) Design Patterns?

The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. Here you will find information on these important patterns.

    Creational Patterns

    • Abstract Factory Creates an instance of several families of classes
    • Builder Separates object construction from its representation
    • Factory Method Creates an instance of several derived classes
    • Prototype A fully initialized instance to be copied or cloned
    • Singleton A class of which only a single instance can exist

    Structural Patterns

    • Adapter Match interfaces of different classes
    • Bridge Separates an object's interface from its implementation
    • Composite A tree structure of simple and composite objects
    • Decorator Add responsibilities to objects dynamically
    • Facade A single class that represents an entire subsystem
    • Flyweight A fine-grained instance used for efficient sharing
    • Proxy An object representing another object

    Behavioral Patterns

    • Chain of Resp. A way of passing a request between a chain of objects
    • Command Encapsulate a command request as an object
    • Interpreter A way to include language elements in a program
    • Iterator Sequentially access the elements of a collection
    • Mediator Defines simplified communication between classes
    • Memento Capture and restore an object's internal state
    • Observer A way of notifying change to a number of classes
    • State Alter an object's behavior when its state changes
    • Strategy Encapsulates an algorithm inside a class
    • Template Method Defer the exact steps of an algorithm to a subclass
    • Visitor Defines a new operation to a class without change

What is the difference between Abstract Factory and Builder design patterns?

The two design patterns are fundamentally different. However, when you learn them for the first time, you will see a confusing similarity. So that it will make harder for you to understand them. But if you continue to study eventually, you will get afraid of design patterns too. It is like infant phobia, once you get afraid at your early age, it stays with you forever. So the result would be that you never look back at design patterns again. Let me see whether I can solve this brain teaser for you.

In the image below, you have both design pattern listed in. I am trying to compare the two one on one to identify the similarities. If you observe the figure carefully, you will see an easily understandable color pattern (same color is used to mark the classes that are of similar kind).

Factory and Builder

Please follow up with the numbers in the image when reading the listing below.

Mark #1: Both patterns have used a generic class as the entry-class. The only difference is the name of the class. One pattern has named it as "Client", while the other named it as "Director".
Mark #2: Here again the difference is the class name. It is "AbstractFactory" for one and "Builder" for the other. Additionally both classes are of type abstract.
Mark #3: Once again both patterns have defined two generic (WindowsFactory & ConcreteBuilder) classes. They both have created by inheriting their respective abstract class.
Mark #4: Finally, both seem to produce some kind of a generic output.

Now, where are we? Aren't they looking almost identical? So then why are we having two different patterns here?

Let's compare the two again side by side for one last time, but this time, focusing on the differences.

  • Abstract Factory: Emphasizes a family of product objects (either simple or complex)
  • Builder: Focuses on constructing a complex object step by step
  • Abstract Factory: Focus on *what* is made
  • Builder: Focus on *how* it is made
  • Abstract Factory: Focus on defining many different types of *factories* to build many *products*, and it is not a one builder for just one product
  • Builder: Focus on building a one complex but one single *product*
  • Abstract Factory: Defers the choice of what concrete type of object to make until run time
  • Builder: Hide the logic/ operation of how to compile that complex object
  • Abstract Factory: *Every* method call creates and returns different objects
  • Builder: Only the *last* method call returns the object, while other calls partially build the object

J2ee Design Patterns Video Tutorial

Source: https://sites.google.com/site/sureshdevang/gof-j2ee-patterns

Posted by: herreravised1943.blogspot.com

0 Response to "J2ee Design Patterns Video Tutorial"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel