This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Which Pattern to use? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Which Pattern to use?" Watch "Which Pattern to use?" New topic

Which Pattern to use?

Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37

I'm building a module for my application which will convert an Excel file to a certain format and the other way too. Now I've started learning patterns, but as you may know there are many and I have a deadline on this. What I need is for someone to tell me "take a look at X pattern", thats all.


Poor is the man whose pleasures depend on the permission of another.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You need a good OO design here. That will do well.

Further, I would like to make it clear that patterns are not a must. If you think, at any point of time, that any specific pattern would fit in, go ahead. We wouldn't be able to tell you which pattern suits the best here, right at this moment without knowing what exactly you are doing and your requirements in a bit detail.

However, would like to remind you few principles of a good OO design.

- Favor composition over inheritance. (Doesn't mean inheritance is useless)
- Program to interface
- Separation of concern
- Single responsibility principle
- Separate out what is likely to change
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3902

Patterns are meant to be some common/generally accepted way of solving certain tasks which would me much harder to develop/maintain otherwise. So if you tell the kind of features/functionality required to achieve your task then we will able to tell which patterns would be suited best for you.

[How to ask questions] [Twitter]
Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37
I was thinking of patterns since my project coordinator has put me to read all this books about patterns and always advices me to think in terms of patterns.

Regarding the project, I have to design a module which receives an Excel file and using this I must code the excel file content to another format. I need another format because its a web application which handles excel files with that specific format.
For example, lets say in cell A2 I have the value 5 then the coded format should be something like this:

That is the simplest example possible, as cells can have formulas and so on.

I hope you understand what I mean and if not, feel free to put some more questions.
Thanks for the replies.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

and just to be pedantic, there is no such thing as a 'java pattern'. A design pattern is something that is not specific to any language, but can be implemented by all (or at least many). you may be doing your implementation of the pattern in java, but it is not a java pattern.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37
I know Fred
I agree. Here's the link:
subject: Which Pattern to use?
It's not a secret anymore!