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?
JavaProgramming

Avatar of undefined
Last Comment
Hugh McCurdy
SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
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
Avatar of for_yan
for_yan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Hugh McCurdy
Hugh McCurdy
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo