aspose file tools*
The moose likes Beginning Java and the fly likes First Real Progam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "First Real Progam" Watch "First Real Progam" New topic
Author

First Real Progam

Gus Hayes
Greenhorn

Joined: Jan 06, 2013
Posts: 19
Hi,
I am nearly finished Head First Java and want to start a project to gain some experience. I work as a technician on postal automation systems and want to use that as my project basis. I want to set up a small Maintenance Management System to keep track of downtime, maintenace issues etc. I want to use MySql as the DB and Eclipse as my IDE. Can anyone please keep me some advice as where to start with planning the Java/MySql end of the project. Thanks.
Gus
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
Welcome to the Ranch

Please search because lots of people ask that sort of question and you will probably get lots of useful hints from their discussions.
At this stage it is premature to specify IDEs, Database programs, etc. Start by writing down a detailed description of what happens (or what ought to happen, which might be different ‍).
Gus Hayes
Greenhorn

Joined: Jan 06, 2013
Posts: 19
Thanks guys,
I am a newbie and appreciate all the help I can get. When you say detailed description, is that an actual written requirements statement that would be followed by uml diagrams etc. Sorry for the simplistic questions.
Regards,
Gus
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11418
    
  16

I would start off more simple than that. I'd start off with plain English. What do you want your program to do? Explain it, in English, in terms a child can understand. "Etc." isn't very clear, for example.

Then, once you have that done, refine it. Focus on one part - perhaps the "Keep track of downtime". Start figuring out how you'll do this, but still in English, as if you had nothing but paper and pencil to keep track.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Gus Hayes
Greenhorn

Joined: Jan 06, 2013
Posts: 19
Thanks Fred & Campbell
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
Fred is right. I meant a plain English description. Later, your second stage will be to use that description to create UML diagrams for your database schema.

And … you’re welcome
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Gus Hayes wrote:I want to use MySql as the DB and Eclipse as my IDE. Can anyone please keep me some advice as where to start with planning the Java/MySql end of the project.

Well, one thing is to read up on JDBC, either in a good book, or the Java tutorials, because it's a good foundation, even if you decide to go with something less direct, like JPA or Hibernate.

I would also suggest that you don't worry too much about the mechanics of the database end just yet (apart from your data model of course).

Like display, I/O (or 'persistance') is fairly interchangeable so, providing you keep all the logic that reads and saves your data separate from the code that presents or manages it, you could start out with a test version that just uses regular files and then add the database layer in afterwards. That separation is really important though, just like it is with display.

And, like Fred and Campbell, I can't stress enough how important it is to do a LOT of thinking on paper before you write any code.

HIH

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Gus Hayes
Greenhorn

Joined: Jan 06, 2013
Posts: 19
Thanks Winston for that great advice
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Gus Hayes wrote:Thanks Winston for that great advice

You're very welcome; and welcome to JavaRanch.

Winston
Gus Hayes
Greenhorn

Joined: Jan 06, 2013
Posts: 19
Hi Winston,
When you say "keep all the logic that reads and saves your data separate from the code that presents or manages it", what exactly do you mean. Is it that the I/O logic should be seperated from the data manipulation logic so making the integration of DB code easier at a later stage.
Gus
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Gus Hayes wrote:When you say "keep all the logic that reads and saves your data separate from the code that presents or manages it", what exactly do you mean. Is it that the I/O logic should be seperated from the data manipulation logic so making the integration of DB code easier at a later stage.

Yup. Basically that's it. Hopefully, it'll let you concentrate on one thing at a time; although it does require a bit more thinking about the design.

Winston
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
It also means you can get part of it working; you can see your database running at the command line/terminal and returning data before you write a single line of Java code.
As Winston says, you can write your display code, your IO code, your database code, your XYZ code all separately and have them all running separately, and then put them together. One of the advantages of OO code (Andy Jack take note, please ) is that you can divide an app into modules and create each module separately.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: First Real Progam