Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Business Archetype Patterns: Archetype Party

Michal L
November 20, 2023

Business Archetype Patterns: Archetype Party

Introduction into the business archetype patterns and description of the Party and Party Relationship archetype patterns. Practical example of archetype Party implementation in Ruby on Rails app.

Michal L

November 20, 2023
Tweet

More Decks by Michal L

Other Decks in Programming

Transcript

  1. A primordial thing or circumstance that recurs consistently and is

    thought to be a universal concept or situation Archetype
  2. PLEOMORPHISM Adaptation of an archetype pattern to a specific business

    context by a modification of its form such that its essential semantics remain unchanged
  3. Adaptation of an archetype pattern to a specific business context

    by a modification of its form such that its essential semantics remain unchanged PLEOMORPHISM
  4. How to apply archetype patterns? 0. Know archetype patterns 1.

    Understand stakeholder requirements 2. Select pleomorph 3. Perform translation/mapping 4. Extend archetype pattern for domain
  5. Identifable, addresable unit that may have a legal status and

    that normally has autonomous control over its actions PARTY 👪
  6. <<archetype>> Party <<o>> description: String getIdentifier(): PartyIdentifier <<o>> getRegisteredIdentifiers(): RegisteredIdentifier[]

    getName(): String getAddresses(): Address[] <<o>> getRoles(): PartyRole[] <<o>> getPreferences(): Preference[] 1..* 0..* << archetype >> Address << archetype >> Person << archetype >> PersonName << archetype >> PartyIdentifier << archetype >> UniqueIdentifier << archetype >> Preference << archetype >> RegisteredIdentifier 1 1 0..* 1 personName <<o>> otherPersonNames << archetype >> Organization << archetype >> OrganizationName 1 1 0..* 1 organizationName <<o>> otherOrganizationNames 1 1 1 <<o>> 1 0..* 0..* <<o>> ARCHETYPE PARTY
  7. ARCHETYPE PARTY RELATIONSHIP <<archetype>> PartyRole <<o>> name: String <<o>> description:

    String getParty(): Party getIdentifier(): PartyRoleIdentifier <<o>> getName(): String <<o>> getDescription(): String <<o>> getRoleType(): PartyRoleType <<o>> getResponsibility( name ) <<o>> assignResponsibility( responsibility: Responsibility) <<o>> removeResponsibility( name ) << archetype >> Party 0..* client 0..1 0..* 1 <<archetype>> UniqueIdentifier getIdentifier(): String <<archetype>> PartyRoleIdentifier identifier: String <<archetype>> PartyRelationship <<o>> name: String <<o>> description: String getClientPartyRole(): PartyRole getSupplierPartyRole(): PartyRole <<o>> getDescription(): String <<o>> getRelationshipType(): PartyRelationshipType <<o>> getName(): String supplier 0..* 1 1 1
  8. Symmetrical relationship << archetype >> PartyRole << archetype >> Party

    << archetype >> PartyRelationship 1 0..* 0..* 1 1 1
  9. Asymmetrical relationship << archetype >> Party << archetype >> PartyRelationship

    << archetype >> PartyRole 0..* 1 1 1 0..* 0..* client supplier
  10. Party Party Role Party Relationship Party Role Party Anakin Father

    Father - Son Son Luke Asymmetrical relationship
  11. <<archetype>> PartyRole <<o>> name: String <<o>> description: String getParty(): Party

    getIdentifier(): PartyRoleIdentifier <<o>> getName(): String <<o>> getDescription(): String <<o>> getRoleType(): PartyRoleType ... << archetype >> Party 0..* 0..* 1 <<archetype>> PartyRoleType name: String description: String canPlayRole (party: Party): Boolean <<o>> canPlayRole (party: Party, context: RuleContext): Boolean <<o>> getConstraints(): PartyRoleConstraint[] ... supplier 0..* 1 <<archetype>> PartyRelationship <<o>> name: String <<o>> description: String getClientPartyRole(): PartyRole getSupplierPartyRole(): PartyRole <<o>> getName(): String <<o>> getDescription(): String <<o>> getRelationshipType(): PartyRelationshipType <<archetype>> PartyRelationshipType name: String description: String canFormRelationship (client: PartyRole, supplier: PartyRole): Boolean <<o>> canFormRelationship (client: PartyRole, supplier: PartyRole, context: RuleContext): Boolean <<o>> getConstraints(): PartyRelationshipConstraint client 1 1 0..* roleType <<o>> 0..* 1 relationshipType <<o>> << archetype >> PartyRoleConstraint <<o>> 1 1..* validTypesOfParty << archetype >> PartyRelationshipConstraint 1..* 1 <<o>> validRolePairs
  12. Party Role Type ARCHETYPE 
 PARTY RELATIONSHIP Party Role Party

    Relationship Party Relationship Type Party Role Constraint Party Relationship Constraint
  13. << archetype >> Party 0..* 0..* 1 <<archetype>> PartyRoleType canPlayRole

    (party: Party): Boolean <<o>> canPlayRole (party: Party, context: RuleContext): Boolean <<o>> getConstraints(): PartyRoleConstraint[] ... supplier 0..* 1 <<archetype>> PartyRelationshipType canFormRelationship (client: PartyRole, supplier: PartyRole): Boolean <<o>> canFormRelationship (client: PartyRole, supplier: PartyRole, context: RuleContext): Boolean <<o>> getConstraints(): PartyRelationshipConstraint client 1 1 0..* roleType <<o>> 0..* 1 relationshipType <<o>> <<o>> 1 1..* validTypesOfParty 1..* 1 <<o>> validRolePairs << archetype >> PartyRole << archetype >> PartyRelationship << archetype >> RuleSet <<archetype>> PartyRoleConstraint typeOfParty: String canPlayRole (party: Party): Boolean <<archetype>> PartyRelationshipConstraint clientRoleName: String supplierRoleName: String canFormRelationship (partyRoleA: PartyRole, partyRoleB: PartyRole): Boolean <<o>> <<o>> 1 1 1 1 requirementsForRole requirementsForRelationship
  14. Scrum team example People first_name: String last_name: String Roles name:

    String description: String Projects name: String start_at: DateTime end_at: DateTime RoleInProjects FK person_id FK role_id FK project_id Supervisions FK subordinate_id FK supervisor_id FK project_id
  15. Scrum team example People first_name: String last_name: String Roles name:

    String description: String Projects name: String start_at: DateTime end_at: DateTime RoleInProjects FK person_id FK role_id FK project_id Supervisions FK subordinate_id FK supervisor_id FK project_id
  16. Scrum team example People first_name: String last_name: String Roles FK

    party_id description: String name: String Projects name: String start_at: DateTime end_at: DateTime Relationships FK supplier_role_id FK client_role_id name: String description: String
  17. Party Role Type ARCHETYPE 
 PARTY RELATIONSHIP Party Role Party

    Relationship Party Relationship Type Party Role Constraint Party Relationship Constraint Responsibilities Capabilities
  18. Party Role Type ARCHETYPE 
 PARTY RELATIONSHIP Party Role Party

    Relationship Party Relationship Type Party Role Constraint Party Relationship Constraint Responsibilities Capabilities Party Summary
  19. Recipe for a great party 👪 1. Identify the types

    of Parties in the system 2. List different types of relationships between them - create Party Relationships 3. Check that party relationships meet identifable business needs 4. Work out what roles different types of parties play in Party Relationships - Party Roles 5. Formulate rules - Party Role Constraints, Party Relationships Constraints
  20. CREDITS Enterprise Patterns and MDA : Building Better Software with

    Archetype Patterns and UML Jim Arlow, Ila Neustadt https://www.amazon.pl/Enterprise-Patterns-MDA-Building-Archetype/dp/032111230X