aspose file tools*
The moose likes Beginning Java and the fly likes Grocery App Ideas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Grocery App Ideas" Watch "Grocery App Ideas" New topic
Author

Grocery App Ideas

David Serio
Greenhorn

Joined: Dec 07, 2009
Posts: 8
Hello, I am new here and hopefully posting in the correct forum.

I have never programmed in an OO language before and am in the process of learning Java. I want to write a simple app to get a feel for the language. It will probably be a console app first (I haven't read up on writing a gui app yet). Basically, I want an app I can keep track of my grocery store purchases. For example, I would enter the date, store, item and price for each item I buy. I am having trouble thinking of how this would translate to Java objects. Here is what I have come up with.

A Store class that would simply contain the name of each store I shop at.
An Item class that contains each item I buy (maybe a category as well).
A Purchase class that contains a date of purchase, an item object, a store object and a purchase amount.

Should I split up each of the above classes in their own file, combine them all in one file??

After finishing my "Learning Java" book, I will probably look for a Design Patterns book, but I wanted to get a jump start on Java apps.


Thanks for reading.
David
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

David Serio wrote:Should I split up each of the above classes in their own file, combine them all in one file??

You'd need to have them in separate files, assuming that each class should be publicly accessible.
David Serio
Greenhorn

Joined: Dec 07, 2009
Posts: 8
David Newton wrote:
David Serio wrote:Should I split up each of the above classes in their own file, combine them all in one file??

You'd need to have them in separate files, assuming that each class should be publicly accessible.


Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Grocery App Ideas