Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Use Singleton or Static Class in this example?

Thread view: 
howachen@gmail.com - 14 Jul 2006 17:32 GMT
Consider the following example:

E.g.

Use a class to load configuration data from database at application
startup, anywhere in the application should be able to access the
configuration information as they are needed.

This example is a classic example of using static class or singleton
plattern, isn't?

Which one you prefer ?  Singleton or Static ?

Thanks...
Danno - 14 Jul 2006 17:42 GMT
> Consider the following example:
>
[quoted text clipped - 10 lines]
>
> Thanks...

For something like that I would need to look at what is being built
around it... Is it a desktop app, a web app, a service?  What is the
purpose of the app? What existing technologies does it depend on, etc.
howachen@gmail.com - 14 Jul 2006 17:50 GMT
Danno

> > Consider the following example:
> >
[quoted text clipped - 14 lines]
> around it... Is it a desktop app, a web app, a service?  What is the
> purpose of the app? What existing technologies does it depend on, etc.

will you have different choice if they are built on different platform?
such as web or desktop? why?
Danno - 14 Jul 2006 18:51 GMT
> Danno
>
[quoted text clipped - 19 lines]
> will you have different choice if they are built on different platform?
> such as web or desktop? why?

Well for example, when creating a web app, loading configuration can
come during servlet context setup using a context listener and from
there I would bind those values to an application context. I have to
say that that is not the only way.  In a desktop app, I would probably
have to do some sort of distributed programming solution or just call
the database directly.  If its also a desktop solution I would like to
know if the configuration files are like a map (key, value) structure,
or they are complex relational objects.  

Lots to consider.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.