Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 2.4 KB

README.md

File metadata and controls

50 lines (34 loc) · 2.4 KB

Java Object Factory

This mini project was created in 2001 for learning/tutorial purposes.

It was recently retrieved from Geocities.com, one of the most popular and successful free personal web hosting services of the 1990s, which was shut down in October 2009.

Apparently all sites hosted on the service would be deleted and could not be recovered.

Thanks to Geocities for not deleting this and many of my other projects.

An Example Using Metadata and Java Reflection

This demo uses metadata and java reflection to create a generic object factory.

The Manager class takes the name of a database table and the name of a java class as parameters and creates a class that represents the database entity. Everything is done with the use of java reflection that finds out how the table is structured in the database.

There is a total of 5 files that compose this demo:

  • DBConnection.java - Establishes connection to the database.
  • Employee.java - Defines Employee class.
  • Department.java - Defines Department class.
  • Manager.java - Factory Class.
  • MainDriver.java - Driver to test.

Technologies

     

Result Screenshot