File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Java practice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java practice " Watch "Java practice " New topic
Author

Java practice

pallavi chaudhari
Ranch Hand

Joined: Jul 02, 2008
Posts: 54
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

Joined: Oct 13, 2005
Posts: 38818
    
  23
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

Joined: Jul 02, 2008
Posts: 54
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

Joined: Oct 13, 2005
Posts: 38818
    
  23
Why have you got three laboratory classes?
pallavi chaudhari
Ranch Hand

Joined: Jul 02, 2008
Posts: 54
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

Joined: Oct 13, 2005
Posts: 38818
    
  23
You should have one Laboratory class.
Or four.
pallavi chaudhari
Ranch Hand

Joined: Jul 02, 2008
Posts: 54
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java practice