• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Real Time Scenario For Singleton Desgnpatter and DAO design pattern

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Can someone please give me example of a real time scenario where Singleton Desgnpatter and DAO design pattern is used
 
Ranch Hand
Posts: 77
Android MyEclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepak,

First i will go for Singleton

there is a funtionallity where you are getting Meta Data on to the form, so if you hit database for every time it is overhead to server. Instead get the data for first time and keep it in cache and use it for everytime untill the Meta data is not changed, if data is changed clear it and again get it from database.

Now DAO pattern

you have a application connecting to different databases like oracle,DB2and MSSQL etc
for the above you have get connections and do some stuff for persisting the data. So for all 4 database you will have to get the 4 connection object , it means there will be 4 classes for getting connection mechanism.
Instead doing such redendunt code, have a factory class , which will give you connection object depending upon database you using .

Damodar
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic