• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java practice

 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I have to implement a use case:

The assignment is to simulate "Mechanical" department of "XYZ College". The department has computer laboratories and equipments.
The department has three computer labs each having some distinct properties/features.

1. OOP Laboratory has a UNIX Server and has a UNIX network
2. NT Laboratory has a VC and has a Windows NT network
3. MP Laboratory has a Linux network

The Department has a Head of Department and 2 Professors.

Each lab has a printer and computers.
Each printer is specified by its type (dot matrix, inkjet or Laser) and its make (HP, SONY or SAMSUNG).
Every Lab has a Lab instructor.
A computer is specified by its name, RAM size, Hard Disk capacity, its Processor speed and Processor make (Intel, AMD).

The Head of Department, the professors and the Lab instructors are Teachers.
A Teacher is specified by his name, date of appointment (dd-MM-yyyy) and qualification.

Then I need to load a list of "Computer" each of laboratory from csv file.

How to start implementing this use case? Design help is highly appreciated.

I do not want code I am posting this for only suggestions and guideline to implement it using best possible way using OOP features.


Thanks




 
Campbell Ritchie
Sheriff
Pie
Posts: 49793
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not actually a use case. A use case is more like this
A student goes into the lab and logs on and expects to find their oold programming available on the server.
Go through the description, and try creating a class for each noun in that description.

You will soon realise that there are several slightly different instances of each class. For example, if you had a car hire firm who have different cars, some Ford, some Mercedes and some BMWs, you would create Car classes, not Ford or Mercedes classes. There are analogies to your present problem.
 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell ,

upto now I have created College,Department,all three laboratory classes and created Computer Bean class.

reading from csv file to show the list for UGLaboratory.

UGLaboratory class is implementing interface in which I have defined all business method related to the this lab only.

One question how remove entry from csv file using I/O (does it removal means only overwriting the file again with new values?)


 
Campbell Ritchie
Sheriff
Pie
Posts: 49793
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why have you got three laboratory classes?
 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because in Test Client class I have to given to :

Create instances of 3 laboratories with following data:

LAN ,Server,etc

How to achieve it then?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49793
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have one Laboratory class.
Or four.
 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:You should have one Laboratory class.
Or four.


Four I understood means : Laboratory class should be abstract. and other 3 will extend from it.

But only one class how it will manage?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic