Are there design patterns for modeling a structure that contains teams, roles, and skills?

I need to model the system in which a team will be created, which will consist of users who play roles in the team and have the skills assigned to them.

i.e. A team of 5 members, one of them acts as the leader of the group, all of them fulfill the response to the role of email, but some of them have the additional skill of answering the phone.

I am trying to determine how I can best model this.

This problem had to be solved earlier, are there any good resources on how to model this?

EDIT: I need to determine what the user is allowed to do, which may be due to the fact that they are in a specific team, perform a specific role or have certain skills assigned

+3
source share
7 answers

I ruined it, so take it with salt. I found this article about role modeling and objects. There is a role template on page 30. I hope this is not a wild goose for you. Here is a summary

Role , , . . Decorators, . . .

+2

, , , . Unit, , Unit. - , . , User. , , . , .

, , .

, ( ), Decorator. , () , ( ) .

, BasicUser AnswerPhoneDecorator. BasicUser, AnswerPhoneDecorator, , .

+2

, , .

, , , . - -, .

, :

class Team
    container[Member] members

class Member
    container[Role] roles
    container[Skill] skills

, , , .

.. . Team Role and Skill -class - Member -class. , .

+1

TeamMember BaseClass 2 (iEmail iPhone). TeamMember , , ... , , TeamMember, .

, . TeamLeader TeamMember iPhone

RWendi

0

, - , , - . , . , , . - , :
, . : , , , , , , / , / .
, : RoleA ( , ), roleB ( ) TeamLeader ( , , , . , ( ): ( ), canAnswerPhone ( , ), e- mail ( , ) ...
, , (, , ..).
, , , , , , , ...

, . !

0

, . , , ?

, - : . ( ) , ( , ). .

, , , .

, ( ), , , , (, , , -, - ...). .

, , . ( ), , :

class Problem
{
  find_problem_solvers()
  {
    var problem_solvers = null
    for each (skill in skills_required)
    {
      var possible_problem_solvers = skill.find_problem_solvers()
      if(problem_solvers == null)
      {
        problem_solvers = new list().add_range(possible_problem_solvers)
      }
      else
      {
        for each problem_solver in problem_solvers:
        {
          if(problem_solver not in possible_problem_solvers)
            problem_solvers.remove(problem_solver)
        }
      }
      //No point continuing if we eliminated everyone!
      if(problem_solvers is empty) break;
     }
     return problem_solvers
   }
 }

, . - -. .

, , .

0
source

I found that Chapter 5 in Enterprise Templates and MDA: Creating Better Software with Archetype and UML Templates discusses how to model relationships correctly

0
source

Source: https://habr.com/ru/post/1698243/


All Articles