Team LiB   Previous Section   Next Section

B.3 Extension Mechanisms and the Object Constraint Language

The next few sections present solutions for Part IV.

B.3.1 Chapter 9

  1. The following describes the figure:

    • Organization is a stereotype definition that applies to classes.

    • Made Of is a stereotype definition that applies to associations.

    • The Organization stereotype has a tag definition named Name. This is a string that represents the name of the organization.

    • The Made Of stereotype has a tag definition named String. This is a string that describes the relationship between an organization and the things that make up the organization.

    • The Organization stereotype defines two constraints indicating that the name of the organization must not be an empty string, and that the organization must be made of at least one other thing (any thing).

    • The Made Of stereotype defines a constraint indicating that the description of the relationship between an organization and the thing that makes up the organization must not be an empty string.

  2. The following describes the figure:

    • The Business class is stereotyped as an organization using the Organization stereotype.

    • The Team class is stereotyped as an organization using the Organization stereotype.

    • The Business class is associated with the Team class in which the association is stereotyped using the Made Of stereotype.

    • The Team class is associated with the Person class where the association is stereotyped using the Made Of stereotype.

    • The Person class is not stereotyped.

  3. The following describes the figure:

    • Publisher is an object of the Business class and is stereotyped using the Organization stereotype. It has the tagged value of "O'Reilly" for its Name tag.

    • Marketing is an object of the Team class and is stereotyped using the Organization stereotype. It has the tagged value of "Nutshell Marketing Team" for its Name tag.

    • Production is an object of the Team class and is stereotyped using the Organization stereotype. It has the tagged value of "Nutshell Production Team" for its Name tag.

    • The Marketing object is linked with the Publisher object in which the link is stereotyped using the Made Of stereotype.

    • The Production object is linked with the Publisher object in which the link is stereotyped using the Made Of stereotype.

    • The Si object is linked with the Marketing and Production objects in which the links are stereotyped using the Made Of stereotype.

    • The Jonathan object is linked with the Production object in which the link is stereotyped using the Made Of stereotype.

    • The Andy object is linked with the Production object in which the link is stereotyped using the Made Of stereotype.

    • The Description tag of each link that is stereotyped using the Made Of stereotype has a tagged value of "TBD" (to be determined).

  4. The following steps show the solution:

    1. Figure B-50 shows the figure.

      Figure B-50. Class diagram (question 4 part a)
      figs/Luml_ab50.gif
    2. Figure B-51 shows the figure.

      Figure B-51. Class diagram (question 4 part b)
      figs/Luml_ab51.gif
  5. The following steps show the solution:

    1. Figure B-52 shows the figure.

      Figure B-52. Class diagram (question 5 part a)
      figs/Luml_ab52.gif
    2. Figure B-53 shows the figure.

      Figure B-53. Class diagram (question 5 part b)
      figs/Luml_ab53.gif

    Figure B-54 shows the resulting diagram, which includes all the steps in this question.

    Figure B-54. Class diagram (question 5)
    figs/Luml_ab54.gif
  6. The following steps show the solution:

    1. Figure B-55 shows the figure.

      Figure B-55. Object diagram (question 6 part a)
      figs/Luml_ab55.gif
    2. Figure B-56 shows the figure.

      Figure B-56. Object diagram (question 6 part b)
      figs/Luml_ab56.gif

    Figure B-57 shows the resulting diagram, which includes all the steps in this question.

    Figure B-57. Object diagram (question 6)
    figs/Luml_ab57.gif

B.3.2 Chapter 10

  1. The following describes the figure:

    • The figure captures the relationships among and details about projects, plans, teams, people, skills, and people's roles on teams and people's experience with skills in the project management system.

    • A plan relates to a single project, a single team, and zero or more people who are human resources of the plan.

    • A project relates to a single plan and relates to a single team.

    • A team relates to a single plan and relates to a single project.

    • A person relates to a single plan.

    • A team relates to zero or more people as members of the team in which a person plays a role. A person relates to a single team where the person plays a role.

    • A skill relates to zero or more people and a person relates to zero or more skills in which the person has experience with the skill.

    • A project has a name that is a string, a start date that is a string, an end date that is a string, a budget that is a real number, and two operations to retrieve the start date and end date of the project.

    • A team has a name that is a string.

    • A person has an identification number that is an integer and a name that is a string.

    • A skill has a name that is a string and a priority that is a string.

    • The relationship between a person and a team defines the title as a string of the role that the person plays on the team.

    • The relationship between a person and a skill defines the years of experience as a real number that the person has with the skill.

    • All the attributes and operations are public, but a project's start and end dates are private.

  2. The following describes the rules:

    1. The priority of a skill must be one of the following: High, Medium, or Low.

    2. The budget of a project must be between 100,000 and 500,000, inclusive.

    3. The name of a team given a role may not be an empty string.

    4. The identification number of a person given a role must be greater than 0 and less than 9999.

    5. The identification number of each member of a team must be greater than 0 and less than 9999.

    6. The identification number of each member of a team must be greater than 0 and less than 9999.

    7. The identification number of each human resource who relates to the plan of a team must be greater than 0 and less than 9999.

  3. The following expressions result:

    1. Within the context of a role, the following expression results:

      self.Title = 'Analyst' or self.Title = 'Architect' self.Title = 'Designer' 
      or self.Title = 'Developer' or self.Title = 'Tester' or self.Title = 'Manager'

      The keyword self is optional and the expressions on either side of the = symbol may be interchanged, but keep in mind this does not apply to > or < symbols, and the expressions on both sides of the or logical operator may be interchanged.

    2. Within the context of experience, the following expression results:

      self.Years >= 5

      The keyword self is optional and the expressions on either side of the >= symbol may be interchanged (in which case the >= symbol becomes the <= symbol).

    3. Within the context of a project, the following expression results:

      self.StartDate = self.plan.StartDate and self.EndDate = self.plan.EndDate

      Or the following expression results:

      self.getStartDate () = self.plan.StartDate and self.getEndDate (  ) = self.plan.EndDate

      The keyword self is optional and the expressions on either side of the = symbol may be interchanged, but keep in mind this does not apply to > or < symbols, and the expressions on both sides of the and logical operator may be interchanged. Notice that the operations to retrieve the start and end dates of a project may be used but are not required, because the rule is expressed within the context of a project.

    4. Within the context of a plan, the following expression results:

      self.StartDate = self.project.getStartDate (  ) and self.EndDate = self.
      project.getEndDate (  )

      The keyword self is optional and the expressions on either side of the = symbol may be interchanged, but keep in mind this does not apply to > or < symbols, and the expressions on both sides of the and logical operator may be interchanged. Notice that the operations to retrieve the start and end dates of a project are used, because the start and end date attributes are private in the project and the rule is expressed within the context of a plan.

    5. Within the context of a person, the following expression results:

      self.team.plan = self.plan

      The keyword self is optional and the expressions on both sides of the = symbol may be interchanged, but keep in mind this does not apply to > or < symbols.

    6. Within the context of a person, the following expression results:

      self.team.plan = self.plan and self.team.project.plan = self.plan

      The keyword self is optional and the expressions on either side of the = symbol may be interchanged, but keep in mind this does not apply to > or < symbols, and the expressions on both sides of the and logical operator may be interchanged.

    7. Within the context of a project, any of the following expressions results:

      self.project.plan = self.plan
      self.project = self.plan.project
      self.project.plan.team = self
      self.plan.project.team = self

      The keyword self is optional in the first two expressions but is required in the last two expressions following the = symbol, and the expressions on either side of the = symbol may be interchanged, but keep in mind this does not apply to the > or < symbols.

    Team LiB   Previous Section   Next Section