wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Design Pattern needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Design Pattern needed" Watch "Design Pattern needed" New topic
Author

Design Pattern needed

Hareesh Ram Chanchali
Ranch Hand

Joined: Jan 31, 2005
Posts: 110
If there is an application which deals with multiple tables sequentially and the logic for population of data is automated for all the tables in such a way that it is achieved in single click.

The total code has been written as a servlet which takes a excel file name as a parameter and get all the sheets (correspond to table name) and sequentially it retrieves the data and before insertion it checks for constraints and then it populates..\

I can not determine the right design pattern

plz tell me design pattern with right references and books


Hareesh Ram Chanchali
SCJP 5.0, IBM Certified Solution Designer
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
do some google on Command Pattern.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Moving to the OO, Patterns, UML and Refactoring forum.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Hareesh Ram Chanchali:
I can not determine the right design pattern

plz tell me design pattern with right references and books

If you can't think of a design pattern that fits your particular situation, it may be better to "just implement it" and look for patterns after the fact. After all, design patterns are not invented but observed.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
See also http://faq.javaranch.com/view?WhenToApplyDesignPatterns


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Hareesh Ram Chanchali
Ranch Hand

Joined: Jan 31, 2005
Posts: 110
Dear Lasse,

May be you are right .
But I hope there should some pattern existed for these kind of aplications previously.

Hope u got me
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I think patterns got so much buzz that people just throw the word into a question like this. Without it "design needed" would be a different topic.

The suggestion to look into Command was about getting tricky logic out of the servlet layer. Many people like a servlet to get parameters from the HTTP request, call the business layer, forward to a JSP that builds the next page, and (almost) nothin else. I like to build apps with a single servlet that gets page name and action from the HTTP request and uses the combination to look up a Command that contains the call to the business layer. That's only one flavor, tho. If you build a servlet per page you don't really need that bit.

That's all kind of high level architecture. For your particular problem it sounds like a series of sequential steps is pretty straight forward. Look up the transactional abilities of your driver & Excel and put all the operations in a single transaction if you can.

Hope that helps. Let us know what you wind up with!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Hareesh Ram Chanchali:
But I hope there should some pattern existed for these kind of aplications previously.


Design patterns don't exist for kinds of applications. They don't solve problems of the kind "I need this functionality implemented".

What design patterns *do* solve are design problems of the kind "I want to remove this duplicated code", "I want to decouple those two classes" or "I need more flexibility in how those objects are instantiated", for example. Until you encounter problems at that scale, looking out for design patterns simply is premature.

Hope this helps...
 
 
subject: Design Pattern needed