Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: knarf; proxy_user; ShadowAce

Perhaps an analogy will help.

***
Scenario: Pointy-Headed Boss (PHB) says to Dilbert: “I need an employee to do ImpossibleTask. And no, you may not hire a new employee from outside.” Dilbert frantically searches the list of employees that he manages for one with the capability of handling ImpossibleTask, and tells that employee to perform ImpossibleTask on PHB’s behalf.
***

Dilbert is the “reflection class” for PHB in this scenario. He can “see into” the capabilities of the employees that he manages and “reflect” those capabilities back to PHB.

PHB doesn’t (have to) know (or care) which employee actually performs ImpossibleTask, as long as Dilbert finds one that does.

In sum, a “reflection” class has the capability of inspecting the attributes (data) and behaviors (actions) of another class and providing that information to another class that requests it.


13 posted on 01/29/2013 7:50:36 AM PST by ShorelineMike (Constituo, ergo sum.)
[ Post Reply | Private Reply | To 7 | View Replies ]


To: ShorelineMike

Here is the problem with reflection:

field.setAccessible(true);


16 posted on 01/29/2013 8:00:32 AM PST by dfwgator
[ Post Reply | Private Reply | To 13 | View Replies ]

To: ShorelineMike

So .. an outsider (hacker) can be called by dilbert or the hacker IS dilbert?


19 posted on 01/29/2013 8:04:19 AM PST by knarf (I say things that are true ... I have no proof ... but they're true)
[ Post Reply | Private Reply | To 13 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson