joshSawYou / CIS255_Vehicle

0 stars 0 forks source link

Project - Individual Files #12

Closed jwood36 closed 1 year ago

jwood36 commented 1 year ago

It is good practice to have 1 Class per File, not multiple classes per File. It is acceptable to have an Enum File that contains all usable Enums in the application.

By putting one Class per File, you are adhering to one of the Abstraction tenants: Separation of Concerns.

joshSawYou commented 1 year ago

I have separated all of my classes into separate*.java files. I placed the enums in the file belonging to whatever the highest class (most parent class) in my UML design that uses them. For example, the Vehicle class is the highest class (most parent class) to use the engineType Enum; thus, I placed this enum in the Vehicle class file. Similarly, The Type class is the highest class (most parent class) to use the vehicleType enum; so, I placed the vehicleType enum in the Type class. I believe all of this separation adheres to the abstraction tenant: separation of concerns. Additionally, I believe this makes my code a lot more organized and readable.