It is common practice to implement roles such as Employee, Customer, etc. as subclasses of a common role player class such as Person. However, this means that different instances of the role classes are actually different objects with different state and different identity, even if they are meant to represent the same logical entity. The Role Object Pattern (ROP) addresses this problem by representing an object and its roles as a composition of one role player object (called the core) and arbitrarily many role objects.
A collection of articles and resources of interest to the modern software developer
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs
Monday, June 13, 2011
Introduce Role Objects
Introduce Role Objects
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment