• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post what you have, and let's see who responds.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


reply
    Bookmark Topic Watch Topic
  • New Topic