Welcome to web Pages of Vicky Shiv

Resume Experience Projects Courses Thesis Download

Company Hiring system

 

Link to Test.java Doc created by Java Doc

Documentation java docLink to Packages

 

This illustrates the use of Bridge Design Patterns and change of data structure at the run time. Persistence of the objects is maintained in the file. Intensive use of inheritance, containers and exception handling is used to built up the system.

Description : Consider a company that keeps tracks of its staff consisting of employees and volunteers. Everybody has two immutable attributes :a name and an address, employees (unlike volunteers ) additionally have a SIN immutable attributes. Employee are paid a salary(per month) or wages(per hours). The following menu operations are available in user defined data structure(single link list) such as hiring a employee, hiring an volunteer, hiring a contract employee, raising a salary/wage of a permanent/contract employee, change of data structure at the run time from list to array, saving the object into the file and retrieving from the file. The design should be flexible for the change in either case i.e.: accommodate other kinds of employees and change of data structure.

Implementation Details

There are four package

  • Container
  • Empl
  • MyException
  • Global

Container Package : This Contains different classes to implement the Generic List or Generic Array

Basically it is divided into two part one is List of Container /Array and Containers of different types of Employee

List of Container /Array is used stored different type of Containers. In order to switch from one implementation to other implementation at run time they are derived from common Abstract class Impl. You can switch from one implementation to other implementation at any time. After switching you are free to do the basic operations ,such as Hiring a contract Employee ,Raising as Salary etc , then again you can go back to the previous implementation. If your List contains more than 10 elements ( Array size) and now you are switching the implementation then only first ten elements will be copied and it will throws an exception for the remaining elements. Array size is taken as ten .

Containers of different types of Employee is derived from the Common Base Abstract Class Container .

Empl Package : This contains different classes to implements Employee

MyException Package : This contains classes to implements Exception handling such as List Empty, EmployeePresent Exception etc.

Global :Package : This package contains one class(MyInput) and used for data Input.

 Executable File (Test.java)

Test .java is used to implements the basic functionality of the Assignment. It has got an implementation as a Text base Menu.
Loading from a file and saving from a file is not specific to a particular file. It will ask for the file name in both the Options
*********M A I N M E N U **********
press '1' to Hire a Permanent Employee
press '2' to Hire a Contract Employee
press '3' to Hire a Volunteer Employee
press '4' to Raise a Salary of an Employee
press '5' to Save the data into a file
press '6' to Load the data from a file
press '7' to print the List
press '8' to change implementation
press '9' to shut down 
 
1