• Post Reply Bookmark Topic Watch Topic
  • New Topic

Code/Design review of 1st project (Employee DB project)?  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not too sure if it is okay to ask this but I have written my 1st Java "project" and was hoping a more experienced Java developer could take a look and review.

It is a simple Employee DB, allowing for creation and viewing of employee records. Validation is pretty mainimal, no proper date validation for example, and uses arrays...no collections at all as I haven't read about those as of yet.

It is a console application and I wrote it primarily as a tutorial based exercise after just finishing 1st Java beginners guide. I am/was hoping some kind expert would take a look and advise on general design, use of API, anti-patterns etc.

Any help would be greatly appreciated.

If anyone is willing to help please let me know so I can post source files.

Thanks in advance.
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post what you have, and let's see who responds.
 
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use code tags though(up at the top(the code button))

 
Gary Fletcher
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. Code is below.

Am not too sure if some of the functionality in the "worker" classes should really be in the Emploee classes, for example I have Employee classes and a seperate EmployeeAdder woker class, should the add functionality actually be within Employee??? Not too sure if I explained that very well, but am sure you'll see when I mean.

Please provided as much constructive critisism as you would like as I really want to design correctly from the offset...bad habits are hard to shake, as you'll notice from the sytle I use with {} - although I still believe this is a clearer style.

EmployeeDB.java - main thread class


EmploeeeMenu.java - concrete class. This is the driver for the application. Display a menu choice and instansiates objects based on user input.


EmloyeeException.java - concrete exception class. User defined Exception class.


EmployeeReader.java - concrete final class. Provides a static method interface which reads Employee details from a file on the file system.


EmployeeWriter.java - concrete final class. Provides a static method interface which writes Employee details to a file on the file system.


MenuProcessor.java - concrete class. Displays menus based on parameters passed on instansiation.
Provides mutator methods so that menus can be changed dynamically.



KBInputProcessor.java - concrete class. Provides functionality to read and validate input from the keyboard/console (System.in)


IEmployeeDisplayer.java - Inteface. Currently contains an enum indicating the display options


EmployeeDisplayer.java - concrete class. Shows employee details to the screen. All Employee classes override toString(). This is used to show the Employee details.


EmployeeSearch.java - Concrete class. Displays a menu for search criteria input. Searches the employees array based on the criteria.


EmployeeAdder.java - concrete class. Provides functionality to add an Emloyee to the database.


EmployeeID.java - concrete class. The ID is an class variable of all Employee classes but must be unique for each employee.
Therefore a file is used to store the current value of the ID value which is updated whenever
a new ID is instansiated



IEmploee.java - Interface. Currently provides a single enum and final statics (implicit) for Employee processing


Employee.java - Abstract class implementing IEmployee


Secretary.java - Concrete class extends Employee, but has no extra functionality


Technical.java - concrete class extends Employee. Provides bonus calculation functionality.


Manager.java - concrete class extends Employee. Provides extended bonus calculation functionality.


Director.java - concrete class extends Manager. Provides extended bonus calculation functionality.


 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!