question 8

Posted Thursday, September 03, 2009 by SacrosanctBlood in

There exist entities Person, Employee and Manager. Where Employee
inherits from Person and Manager inherits from Employee.

How can you take a person object and make it an employee object, and how
can you take an employee object and make it a manager object(Say, the
person becomes an employee, and then gets a promotion to manager)?

No, the solution is not about creating a new Employee object and get/set
from a Person object to set the properties.. :-)



1 comment(s) to... “question 8”

1 comments:

SacrosanctBlood said...

This can be achieved using Dynamic proxies in java. There is a nice
article that provides solution to the same problemo :-) Please look at
the link below, you will understand the concept in some details..



The solution is on page 3, please read through all the 4 pages for
details..



http://www.javaworld.com/javaworld/jw-11-2000/jw-1110-proxy.html?page=3



Post a Comment