Skip to main content

J2EE Design Patterns



Creational Design Pattern

Creational: Singleton



when to use :
Used in Logging, Cache, Session, Drivers 


Creational: Factory 
When to use :


Implementation :

Factory chooses the objects, DAO, Abstract DAO factory 



Creational:builder  
Defines essiential parameter in constructor & optional in setters & add build method .Call build method at the end.







Creational: Prototype






  

Creational:AbstractFactory 
Structural 

improves  the structure of code
Structural: prototype 

Clone method 

Structural: proxy 

Structural: Facade 





Structural: Composite Design Pattern

 
Structural: Flyweight Design Pattern



Structural: Adapter



 

Structural: Bridge 



Behavioural

Behavioural:template 

Subclass defines behvaiour , order of exectution can be defined in superclass  

Behavioural:Observer 

Subclass defines behvaiour , order of exectution can be defined in superclass 


Concurrency Patterns


Thread pool Pattern is special case of Object pool design pattern 







Comments

Popular posts from this blog

The BattleGround

Last Sunday while zapping the channels of my idiot box I chanced upon to watch one of the greatest epic of our times –MAHABHARAT. It did’nt take me much time to recall the waves that it created across the nation- when it was telecasted for the first time.I was too young to comprehend it,yet I used to watch it with paramount interest,sitting next to dad & imitating his stimuli to what character speaks Later in my teens ,unlike most of my friends who used to enjoy watching top tens & horror shows , I was inundated to discover that zee was going to re telecast Mahabharat .This time, I was grown up enough to understand it,so I religiously watched all the episodes with same interest. Watching such an epic in formative years has great influence on one’s approach towards life .Today to me ,Mahabharat isn’t just another epic but it is a thinking process, where the mind is the battleground, THE KURUSHETRA ,where all kind of thoughts hover, the state of mind that we...

WHERE THE MIND IS WITHOUT FEAR !

(Painting By Takshila Vidushi) "Where the mind is without fear & the head is held high Where knowledge is free Where the world hasn't been broken up into fragments By narrow domestic walls Where words come out from the depth of truth Where tireless striving stretches its arms towards perfection ! Where the clear stream of reason has not lost its way Into the dreary desert sand of dead habit Where the mind is led forward by thee Into ever-widening thought and action Into that heaven of freedom, my Father, let my country awake." By Guru RabindraNath Tagore (Ever since childhood this poem of RabindraNath Tagore has been synonmous to supreme level of perfection for me.Its incredibl...

JS Concepts: Data types : Arrays - revisted

Array methods Declaring arrays let arr = [item1, item2] let arr1 = new Array(); looping over array for (let i=0; i  – works fastest, old-browser-compatible. for (let item of arr)  – the modern syntax for items only, for (let i in arr)  – never use . Arrays provide a lot of methods. To make things easier, in this chapter they are split into groups. Add/remove items We already know methods that add and remove items from the beginning or the end:      arr.push(...items)  –  adds items to the end,     arr.pop()  –  extracts an item from the end,      arr.shift()  –  extracts an item from the beginning,    arr.unshift(...items)  –  adds items to the beginning splice arr.splice(index[, deleteCount, elem1, ..., elemN]) arr . splice ( 0 , 3 , "Let's" , "dance" ); arr . splice ( 0 , 2 ); arr . splice ( 2 , 0 , "complex" ...