Link to home
Start Free TrialLog in
Avatar of Eindoofus
Eindoofus

asked on

What is the best practice for naming my classes and packages in the given situation?

I have a project for my object-oriented software development class where I am required to create a PassengerShip for a space fight simulator.

I was planning on having the PassengerShip use the PassengerShip interface along with the PassengerShipImpl and PassengerShipFactory, in case in the future I need to make more than one type of PassengerShip.

I was going to put the PassengerShip in the package "domain", and the PassengerShip interface and PassengerShipImpl in the "passengership" package", and lastly have the "PassengerShipFactory" in the package named "common".

 Is this the best way of naming the packages? I got the idea for the common, passengership, and domain based on some same code my instructor posted pertaining to something else, but it was something he quickly whipped together for a different topic.

And now for my PassengerShip, I want to have the ability to vary the implementation of the PassengerShip later so I decided to create an impl and factory class but the problem is I don't know what to name my interface. Right now they have the same name which doesn't work and based on the project guidelines I have to call the domain class PassengerShip, so what do I call the interface?
SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eindoofus
Eindoofus

ASKER

I thought that it might be good practice to do so since I saw that my instructors code was doing that.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial