Archetypes and Archetype Patterns
Krishnaprasad P.K
Slide 1
Syllabus – Module II • Archetypes and Archetype Patterns, Model Driven Architecture with Archetype Patterns. Literate Modeling, Archetype Pattern. , Customer Relationship Management (CRM) Archetype Pattern, Product Archetype Pattern, Quantity Archetype Pattern, Rule Archetype Pattern. Design Patterns, Creational Patterns, Patterns for Organization of Work, Access Control Patterns, Service Variation Patterns, Service Extension Patterns.
Slide 2
Pattern – A pattern is a reusable solution that can be applied to commonly occurring problems in software design. – Another way of looking at patterns are as templates for how we solve problems. – Design patterns have three main benefits: 1. Patterns are proven solutions: They provide solid approaches to solving issues in software development using proven techniques. 2. Patterns can be easily reused: A pattern usually reflects a solution that can be adapted to suit our own needs. 3. Patterns can be expressive: It contains a set structure and vocabulary to the solution, that can help express large solutions quite simply.
Slide 3
Pattern – Patterns are not an exact solution. – The role of a pattern is merely to provide us with a solution scheme.
– Advantages of patterns. 1.
Reusing patterns assists in preventing minor issues that can cause major problems in the application development process. »
Less time on structure of code and more time on quality of solution.
2. Patterns can provide generalized solutions which are documented in a fashion that doesn't require them to be tied to a specific problem. 3. Certain patterns can actually decrease the overall file-size footprint of our code by avoiding repetition. 4. Patterns that are frequently used can be improved over time by harnessing the collective experiences other developers using those patterns contribute back to the design pattern community. Slide 4
Archetype – “An archetype is a primordial thing or circumstance that recurs
consistently and is thought to be a universal concept or situation“.
– Archetypes are a basic human mechanism for organizing, summarizing, and generalizing information about the world, and have some application in the field of software development. – Business archetype: a primordial thing that occurs consistently and universally in business domains and business software systems, refer as archetypes for short. – Business archetype pattern: a collaboration between business archetypes that occurs consistently and universally in business environments and software systems, refer as archetype patterns for short. Slide 5
Characteristics of archetypes and archetype patterns: – Universal: for something to be archetypal, it must occur consistently in business domains and systems. – Pervasive: it occurs in both the business domain and the software domain.
Slide 6
Archetypes & analysis classes – In object modeling, there are two fundamentally different types of classes. They are. Type of class
Semantics
Analysis class
•Maps onto real-world business concepts.
Design class
•Incorporates features from both the problem domain and the solution domain (implementation technology)
– An analysis class arises directly from the problem domain (e.g., Selling furniture) and has no implementation-specific features. » They are for understanding the business.
– A design class may contain features from both the problem domain and the solution domain (e.g., J2EE, .Net, or web services). » They are for understanding the technical solution.
– Archetypes are always at a higher level of abstraction than normal Slide 7 analysis classes.
Pattern – Pattern: a solution to a problem in a context. – A pattern consists of a description of a problem, the context of the problem, and a possible solution to that problem in that context. – A pattern is a "recipe" that describes how you may solve a particular problem under particular circumstances. – A design pattern has four elements: » » » »
Pattern name: the name of the pattern. Problem: the description of the problem that the pattern solves. Solution: the design of the pattern itself as a UML model. Consequences: the effects of applying the pattern.
– Patterns can occur at different levels of abstraction: » Archetype patterns. » Analysis patterns. » Design patterns. Slide 8
Archetype Patterns – “Analysis patterns are groups of concepts that represent a common
construction in business modeling. It may be relevant to one domain, or it may span many domains”
– Archetype patterns model archetypes and relationships between archetypes, not analysis classes and their relationships. – Archetype patterns explicitly allow variation. – Some parts of the pattern are optional when the pattern is adapted to a specific business domain. – An archetype pattern is a special type of platform-independent model (PIM).
Slide 9
UML profile for archetypes & archetype patterns: – You can model archetypes by using the class icon and adding the stereotype «archetype» to indicate that the classifier represents an archetype. – All archetypes in a archetype pattern are optional.
– «archetype pattern»: – This stereotype applies to packages and collaborations.
Slide 10 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
UML profile for archetypes & archetype patterns: – – – –
«archetype pattern library» This stereotype applies to packages. It is a subtype of the standard UML stereotype «model». We can use our domain name as the name of the package (e.g., clearviewtraining.com).
– We can model an archetype pattern library as shown below.
Slide 11 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
UML profile for archetypes & archetype patterns: – – – –
«o» This stereotype applies to relations, attributes, and operations. A feature is optional and may be omitted. When «o» is applied to a relationship, it indicates that the relationship is optional.
Slide 12 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
UML profile for archetypes & archetype patterns: • When this archetype pattern is instantiated in one of your models, there are four possible ways to make this instantiation. • Model is notated using the ordinary package symbol (a folder icon) with a small triangle in the upper right corner of the large rectangle.
Slide 13 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
Pleomorphism – Pleomorphism is the adaptation of an archetype pattern to a specific business context by a modification of its form such that its essential semantics remain unchanged.
Slide 14 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
UML profile for archetypes & archetype patterns: – «pleomorph» – This stereotype may be applied to refinement relationships between archetype patterns as shown below example. – The archetype pattern at the source of the arrow is a variation (pleomorph) of the archetype pattern pointed to by the arrow – In the figure the IdenticalProduct archetype pattern is a variation of the Product archetype pattern for a specific business domain.
Slide 15 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
Modeling style – Goals » Make the models as readable as possible. » Make the models as useful as possible. » Make the models as precise as possible.
– Style: » Indicate optional by using the stereotype «o». On an attribute, operation, relationship. » Everything that is not explicitly optional is mandatory. » Show exact multiplicity. If not shown it does not default to 1. » Refine each association relationship as much as we can.
Slide 16
Variation – Archetype pattern it explicitly addresses the problem of pattern variation. – Different business domains require different models of the same thing. – Archetype variation: » We can add new features. » We can omit optional features.
– Archetype pattern variation: » Pattern configuration: taking only those parts of a pattern that you need.
– Pleomorphism: » Pleomorphism: the adaptation of an archetype pattern to a specific business context by a modification of its form such that its essential semantics remain unchanged. Slide 17
How to find archetype patterns – You need a detailed knowledge of the business domain of interest. – Different companies may have only a partial view of a broad domain such as "selling.“ – Sources of archetype patterns: » Domain expert interviews: • Seek experts with a broad and deep knowledge of the domain. • Ask open rather than closed questions. – E.g: "How do you sell things?" than, "How do you sell books?" • Look for fundamental concepts.
» Literature: • Books or other external documents about a business domain, in-house publications.
» Models, both data and object models: • Generalize to an archetypal case from what might be a specific business solution. • Skill develop over time as we inspect more and more models. Slide 18
Model management for archetype patterns: – Place each archetype pattern in its own package stereotyped «archetype pattern». » This package should be named after the key. • ArchetypePattern, MoneyArchetypePattern
– Create a package stereotyped «archetype pattern library» that contains all of your archetype patterns. » It needs to have a globally unique name so you can mix it with pattern libraries from other sources without namespace clashes. » Use your domain name as the name of the package.
– As appropriate, group within your main archetype pattern library. archetype patterns into sublibraries . » Name each sublibrary according to an aspect of your business domain (e.g., Marketing, Manufacturing, and ResourceManagement).
– Create a literate model for the archetype patterns. Slide 19
Using archetype patterns in models – Prerequisites: » Understand your business requirements. » Understand the patterns.
– Application: – Choose an appropriate pleomorph. – Select what parts of the pattern to use. – Apply (instantiate) the pattern in one of two ways: » Translation (isomorphism): use the pattern as is. • Each archetype becomes a class in your analysis model.
» Mapping (homomorphism): map the pattern into the domain language of your specific problem. • Each archetype maps to one or more classes in your analysis model.
– Add to the instantiated pattern. – Incorporate into your analysis model. Slide 20
Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
Slide 21 Source: Jim Arlow, “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML”
Applications of archetype patterns – Using archetype patterns for quality: » Archetype patterns can be used as quality mechanisms in software development.
– Using archetype patterns with extreme programming (xp): » XP is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements.
– Archetype patterns and messaging (ebxml): » ebXML is the Electronic Business Extensible Markup Language. It is a set of specifications to support electronic interchange by parties in a peer-to-peer relationship when the interchange crosses domains of control. » Archetype patterns define the structure of software systems. » ebXML defines the structure of the communications between software systems. » Archetype patterns are designed to be compatible with ebXML Slide 22
Reference [1] Jim Arlow, Ila Neustadt “Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML” 2nd Edition
Slide 23