encyclopegia.org

Role Class Model

In computer science, the role class model is a role analysis pattern described (but not invented ) by Francis G.[src] Mossé in his article on Modelling Roles.[src] The role class pattern provides the ability for a class to play multiple roles and to embed the role characteristic in a dedicated class.[src] In our society, as we built it, roles are everywhere.[src] Anyone trying to work in a team to create something has a role.[src] In cinematography, many different persons take part in the creation of a film: the film director, the producer, actors, play writer(s), etc.[src] Even our State organisations are based on various roles.[src] In a Republic, you have a President, Ministers, Deputies, etc.[src] Dealing with these situations is one of the problems encountered most during object-oriented analysis.[src] Francis G.[src] Mossé has identified 5 role analysis patterns that can be used to solve most role related problems: Role Inheritance, Association Roles, Role Classes, Generalised Role Classes and Association Class Roles.[src] They all have various degrees of constraints, flexibility or power, which together offer a complete solution to most role-related problems.[src]

In computer science, the role class model is a role analysis pattern described (but not invented ) by Francis G.[src] Mossé in his article on Modelling Roles.[src] The role class pattern provides the ability for a class to play multiple roles and to embed the role characteristic in a dedicated class.[src] In our society, as we built it, roles are everywhere.[src] Anyone trying to work in a team to create something has a role.[src] In cinematography, many different persons take part in the creation of a film: the film director, the producer, actors, play writer(s), etc.[src] Even our State organisations are based on various roles.[src] In a Republic, you have a President, Ministers, Deputies, etc.[src] Dealing with these situations is one of the problems encountered most during object-oriented analysis.[src] Francis G.[src] Mossé has identified 5 role analysis patterns that can be used to solve most role related problems: Role Inheritance, Association Roles, Role Classes, Generalised Role Classes and Association Class Roles.[src] They all have various degrees of constraints, flexibility or power, which together offer a complete solution to most role-related problems.[src] ==Intent== A model that allows a class to play one or more roles at the same time.[src] A role - as defined by Francis Mossé in Modelling Roles - is a concept of a purpose that a class could have in a certain context.[src] ==Context== The following example is given: Many persons work on a film, each of them with a different role.[src] At the difference of other concepts, a person is not restricted to one role.[src] One could be both the director and a character in a film.[src] Modelling roles for such a concept would require that a class could play more than a single role.[src] A solution using inheritance to conceptualise a role - cf.[src] the Inheritance Role Model - is not possible, as this would allow a person to play only a single role.[src] As one can see in Figure 1 below, the inheritance role model says that a character, who is a person, is playing in a film.[src] But there is no way to say that the person playing the character is also the director.[src] Because, the inheritance makes a character a person in general, not a particular person.[src] meta model representation)]] ==Problem== As explained in Context, using inheritance to play more than one role cannot be considered, because a class could not play two roles at the same time in such a context (cf.[src] the Inheritance Role Model).[src] The expectation is to have a model where a class could be seen as more than one concept or role, and where attributes specific to one of those concepts can be specified.[src] ==Solution== A solution to the previous problem could be to use the Association Role Model, which could create an association between a person and a film.[src] However, specific information on each role could not be stored in such a case.[src] The role class model provides the flexibility of the association with role-specific attributes and even class operations, if needed.[src] meta model representation)]] This meta model - in Figure 2 - shows the role class like an element linking the Client and the BaseClass.[src] For the Client interacting with the Role is like interacting with the Base Class itself, but from the perspective, it is expecting.[src] The advantage having the role as a class is that attributes can be bound to it.[src] Another situation where the Role pattern is interesting is when you've the following situation: Then you realise that as a contract holder, the Person has specific attributes.[src] The holder UML role becomes a dedicated class ContractHolder with these specific attributes.[src] Note that in that case that the multiplicity near Person and Contract are always 1.[src] It means that you've one ContractHolder object for each association between a Contract and a Person.[src] ===Real-world example=== ====Cinema==== A simple application of the role class model in a real example is in the 7th art (see Figure 3), the cinematography.[src] This art involves a creation (the Film) and people to create it.[src] Each person has a different role in the film, they could be actors and play characters, they could be director or scenarist, etc.[src] A person is not limited to one role in a film, they can be both actors and directors and even more.[src] For example, the film Scoop (2006) has been directed by Woody Allen, he is also the scenarist and he plays the role of Sid Waterman.[src] class diagram representation).[src] Click to enlarge.]]In Figure 4, one can see in more detail the role that each person can play in a film.[src] From the film, it is possible to ask the list of crews and cast that help elaborated it.[src] Each person has one or more roles (e.g.[src] actor, director, producer, cameraman, etc.) in the film and can participate in more than one film.[src] A person could even be an actor in a film and a producer in another.[src] One advantage of using a role class in the case of the actor role is that the character qualities can be stored within the role.[src] This is true for the actor role, this is also true for other roles, however maybe not all.[src] Only a few of the possible role have been modelled in Figure 4.[src] One remark easily visible is that not all the role needs attributes and using the role class model for all of them is unnecessary (like for the Director role).[src] In addition, there is a lot of redundancy between each role class.[src] Redundancy in computer science means more work in maintenance, which is not wished.[src] ==Strengths and weaknesses== The employment of this model depends on the business process.[src] The analysis pattern "Role Class Model" offers a possibility to employ a model with linking between a base class and the client.[src] In addition inheritance is not a part of the solution because of the flexibility of zero or multiple roles (role-specific attributes and operations).[src] Strength implies also its counterpart's weakness.[src] The problem of the role class model is the redundancy, for example the method getName is visible in all of the role classes described in Figure 4.[src] If this is considered inconvenient, the role class generalisation model as defined in Modelling Roles is a possible way to go.[src] Actor-Role Pattern, A JPA Implementation https://web.archive.org/web/20071105232543/http://www.ibstaff.net/fmartinez/?p=16[src]

72 sentences · 72 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Role Class Model." encyclopegia.org, 2025, https://encyclopegia.org/wiki/role-class-model. Accessed 27 November 2026.

Chicago

"Role Class Model." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/role-class-model.

APA

encyclopegia.org. (2025). Role Class Model. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/role-class-model

Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Minas Geraes-class battleship

stub · references available

Baykal-class motorship

stub · references available

Top Model O Reality

stub · references available

Top Model of the World

stub · references available

ZIM America-class container ship

stub · references available

Baptista de Andrade-class corvette

stub · references available

Independence-class littoral combat ship

stub · references available

Greyhound-class destroyer

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1318978665 · 0.5 · snapshot enwiki-001318978665

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.