Hello. Im just starting out to learn
java. I follow a course, and I have now been given a fairly big project (big for me as a beginner that is). I must point out I struggle quite a bit with understanding the whole picture
of the object oriented part, having just been introduced to it. If someone could look at the project details I will describe later and give me some pointers as to how to design/layout, and why, I would be
very greatful.
Im going to make a program that will register tenants of one appartment building(a company owns it and needs a program to administer). I need to register which room each tenant rents. Im also required to register
several more categories of information about the tenants. There are certain requirements like, there must be 4 classes, and objects of three of them to be accepted.
The program should be able to read/save information about who lives in which room/they dont all pay the same rent ++ from/to a file. The user should be able to administer the program through a console menu, and be able to register new tenants, see an overview/list of all the appartments with tenants, the rents they pay etc.
My problem is I struggle with understanding how to build all this, or how to lay it out. I am able to make arrays, arrays with pointers to objects, read/write to file, make constructors with paramenters etc in tiny programs, where
this is mostly what you do. But with all these classes Im getting nowhere. Ive been looking into UML quite a bit, and Ive seen UML examples of similar programs where they have 3 classes, this was designed in UML as 3 classes
with no less than four pointer arrays (from what I understood at least).
Main is used simply to move the program into another class where the menu system will be among other things. The objects of the three classes should be something like this
class Tenants: name, account(with the company), class AppartmentBuilding : rent, pointer to tenants. And the class where the menu system(lets call this Menu class) is as well should contain one object (the building as a whole, certain static expenses).
For instance I have a two dimensional array so far in the Menu class (the rooms are name: number letter X Y). Can this array(with pointers) then be used to call a constuctor in the other two classes?
or to create objects as I read from the file? this is one of many problems I have.
As i mentioned I have a lot of problems getting started. Im not asking for someone to code this for me, I just want some good ideas on how to structure it, and why. Thank you.
regards