OO design
Good day.
I have a question, what is the best wat to design desktop application.
The aim of it is to connect to DB, get some data, insert some data, update some data.
This application will be like a small business model of my department.
It will help to control the state of incoming and outcomming documents (for example agreement with client).
So the question is: what is the best way to design classes?
For example I have table "Person" in DB, so I will have the same Class. It will have fields like table in DB and neccessary methods.
I will have Class for establishing connection with DB.
This Class will keep pointer to connection.
So logical structure is separated from technical structure (like connection to DB).
So what else do I have to keep in mind?
[829 byte] By [
Holoda] at [2007-11-26 19:07:25]

# 1
This is the kind of question people write books about. Nobody is going to be able to give you a proper answer in this format. You'll probably have better luck searching the internet.
# 2
Yes, the question is too conplicated.Maybe you can suggest me some book or web-resource devoted to my topic.I can't formulate my question for query to google :)It't too big.
# 3
What is the best way to breathe? ...thru the nose or through the mouth?IMO, it is best to breathe through the nose when there are no foul odors. And through the mouth when stinky things are present.
# 4
Very beautiful answer.I got a lot of useful information.But that means you can suggest me something more practical besides proverbs and awesome wisdom thoughts?
# 5
I don't know where to start. To be honest, if you are asking this kind of question and are going to be designing this on your own, your chances of producing a really good design ar pretty low. Design takes experience. Even if I pointed to a hundred books you wouldn't have the context to really apply the information. Some of the worst designs are created by following poorly understood advice and principles. I wouyld suggest finding a mentor. Other than that here as some basic principles you should follow. These will be easier to find information on as they are more specific:
Keep your business logic and presentation (gui) decoupled. You should not have any business logic embedded in GUI controls. Lookup MVC.
Likewise try to keep the business logic separate from the persistence model.
Use tools and techniques to solve problems. Do not take a tools or techniques and try to find a problems to solve with them. In other words, problems come first, solutions come second. It's sounds stupid but so many problems in software are caused by a lack of a clear understanding of the problem.
# 6
maybe, http://www.amazon.com/Java-Web-Servlets-JSP-EJB/dp/073571195Xdocument management
# 7
Thank you, mchan0Seems like it is exactly what I need!
# 8
dubwai
Thank you.
I agree with you, I do not have any practical experience so anyway I'll do mistakes.
The most expensive mistakes developers do on the designing and planning stage. It takes lots of time to put away mistakes, which were done on the disign stage.
Ofcourse, I understand that DB_connection, Business logic and GUI are separated instances.
That kind of beans.
If you succeeded, for example in DB_connection module, you can easelly reuse it in another project.
If you can't do that, it means you wrote bad code and made bad OO design.
With help of the books I can avoid typical mistakes, but ofcourse real understanding of OO design I can get through practical work.
# 9
i would temper your excitement, it is a toy example.> Seems like it is exactly what I need!
# 10
Anyway, it is impossible to accept into your mind all conseption of OO design.But such book will help me to start.Now I am trying to find it in Russia.If somebody can sell this book to me, please, e-mail me.
# 11
Hi,I suggest you go for OR-mapping framework like Hibernate :)Regards,Kumar
# 12
Hey you asked a question like how to become a James Bond!
I understand that you are in to desingning/architecting an application.
I second dubwai's suggestions..
One thing that i would like to tell is gather as much information as possible about your application and understand what it is exactly going to do.. well this for sure 'll take a good time... because technically the architecture remains the backbone for any knid of application and domain knowledge is the backbone for any application!
Here we go..
I have put things in simple words for your quick understandability
Though is unadvisable to say anything without knowing about your application, Looking at your kind of question, i guess the application is a small and non critical one (if it is big or critical the following basic architecture will require expert enhancements/add ons)..
I suggest you to use...
MVC architecture (hope you have some idea about this else pls google..)
A delegete layer - where you delegate your business logic from the model
A Service layer - to access your db
DAO's - to access db
DTO for transient objects
And finally a good brain to put these thing together and make it work!
All the best! :-)
