• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Grocery App Ideas

 
David Serio
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic