GentleIntrotoSPSchemaPatterns
GentleIntrotoSPSchemaPatterns
Documentation
Documentation shall mean, whether in electronic or printed form, User's Guides, Installation Guides, Reference Guides,
Administrator's Guides, Customization Guides, Programmer's Guides, Configuration Guides and Help Guides delivered with a
particular software product.
Other Documentation
Other Documentation shall mean, whether in electronic or printed form and delivered with software or on Intergraph Smart
Support, SharePoint, or box.net, any documentation related to work processes, workflows, and best practices that is provided by
Intergraph as guidance for using a software product.
Terms of Use
a. Use of a software product and Documentation is subject to the Software License Agreement ("SLA") delivered with the
software product unless the Licensee has a valid signed license for this software product with Intergraph Corporation. If the
Licensee has a valid signed license for this software product with Intergraph Corporation, the valid signed license shall take
precedence and govern the use of this software product and Documentation. Subject to the terms contained within the
applicable license agreement, Intergraph Corporation gives Licensee permission to print a reasonable number of copies of
the Documentation as defined in the applicable license agreement and delivered with the software product for Licensee's
internal, non-commercial use. The Documentation may not be printed for resale or redistribution.
b. For use of Documentation or Other Documentation where end user does not receive a SLA or does not have a valid license
agreement with Intergraph, Intergraph grants the Licensee a non-exclusive license to use the Documentation or Other
Documentation for Licensee’s internal non-commercial use. Intergraph Corporation gives Licensee permission to print a
reasonable number of copies of Other Documentation for Licensee’s internal, non-commercial use. The Other
Documentation may not be printed for resale or redistribution. This license contained in this subsection b) may be
terminated at any time and for any reason by Intergraph Corporation by giving written notice to Licensee.
Disclaimer of Warranties
Except for any express warranties as may be stated in the SLA or separate license or separate terms and conditions, Intergraph
Corporation disclaims any and all express or implied warranties including, but not limited to the implied warranties of
merchantability and fitness for a particular purpose and nothing stated in, or implied by, this document or its contents shall be
considered or deemed a modification or amendment of such disclaimer. Intergraph believes the information in this publication is
accurate as of its publication date.
The information and the software discussed in this document are subject to change without notice and are subject to applicable
technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document.
The software, Documentation and Other Documentation discussed in this document are furnished under a license and may be
used or copied only in accordance with the terms of this license. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE
THE FINAL EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.
Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and symbol data.
Users should verify for themselves that the data is accurate and suitable for their project work.
Limitation of Damages
IN NO EVENT WILL INTERGRAPH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL
INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO, LOSS OF USE OR PRODUCTION,
LOSS OF REVENUE OR PROFIT, LOSS OF DATA, OR CLAIMS OF THIRD PARTIES, EVEN IF INTERGRAPH
CORPORATION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
UNDER NO CIRCUMSTANCES SHALL INTERGRAPH CORPORATION’S LIABILITY EXCEED THE AMOUNT THAT
INTERGRAPH CORPORATION HAS BEEN PAID BY LICENSEE UNDER THIS AGREEMENT AT THE TIME THE CLAIM IS
MADE. EXCEPT WHERE PROHIBITED BY APPLICABLE LAW, NO CLAIM, REGARDLESS OF FORM, ARISING OUT OF OR
IN CONNECTION WITH THE SUBJECT MATTER OF THIS DOCUMENT MAY BE BROUGHT BY LICENSEE MORE THAN
TWO (2) YEARS AFTER THE EVENT GIVING RISE TO THE CAUSE OF ACTION HAS OCCURRED.
IF UNDER THE LAW RULED APPLICABLE ANY PART OF THIS SECTION IS INVALID, THEN INTERGRAPH LIMITS ITS
LIABILITY TO THE MAXIMUM EXTENT ALLOWED BY SAID LAW.
Export Controls
Intergraph Corporation’s commercial-off-the-shelf software products, customized software and/or third-party software, including
any technical data related thereto (“Technical Data”), obtained from Intergraph Corporation, its subsidiaries or distributors, is
subject to the export control laws and regulations of the United States of America. Diversion contrary to U.S. law is prohibited. To
the extent prohibited by United States or other applicable laws, Intergraph Corporation software products, customized software,
Technical Data, and/or third-party software, or any derivatives thereof, obtained from Intergraph Corporation, its subsidiaries or
distributors must not be exported or re-exported, directly or indirectly (including via remote access) under the following
circumstances:
a. To Cuba, Iran, North Korea, the Crimean region of Ukraine, or Syria, or any national of these countries or territories.
b. To any person or entity listed on any United States government denial list, including, but not limited to, the United States
Department of Commerce Denied Persons, Entities, and Unverified Lists, the United States Department of Treasury
Specially Designated Nationals List, and the United States Department of State Debarred List
(https://build.export.gov/main/ecr/eg_main_023148).
c. To any entity when Customer knows, or has reason to know, the end use of the software product, customized software,
Technical Data and/or third-party software obtained from Intergraph Corporation, its subsidiaries or distributors is related to
the design, development, production, or use of missiles, chemical, biological, or nuclear weapons, or other un-safeguarded
or sensitive nuclear uses.
d. To any entity when Customer knows, or has reason to know, that an illegal reshipment will take place.
e. Any questions regarding export/re-export of relevant Intergraph Corporation software product, customized software,
Technical Data and/or third-party software obtained from Intergraph Corporation, its subsidiaries or distributors, should be
addressed to PPM’s Export Compliance Department, 305 Intergraph Way, Madison, Alabama 35758 USA or at
[email protected]. Customer shall hold harmless and indemnify PPM and Hexagon Group Company for
any causes of action, claims, costs, expenses and/or damages resulting to PPM or Hexagon Group Company from a
breach by Customer.
Trademarks
Intergraph®, the Intergraph logo®, Intergraph Smart®, SmartPlant®, SmartMarine, SmartSketch®, SmartPlant Cloud®, PDS®,
FrameWorks®, I-Route, I-Export, ISOGEN®, SPOOLGEN, SupportManager®, SupportModeler®, SAPPHIRE®, TANK, PV Elite®,
CADWorx®, CADWorx DraftPro®, GTSTRUDL®, and CAESAR II® are trademarks or registered trademarks of Intergraph
Corporation or its affiliates, parents, subsidiaries. Hexagon and the Hexagon logo are registered trademarks of Hexagon AB or
its subsidiaries. Microsoft and Windows are registered trademarks of Microsoft Corporation. MicroStation is a registered
trademark of Bentley Systems, Inc. Other brands and product names are trademarks of their respective owners.
Introduction
Did you read "A Gentle Introduction to the SmartPlant® Schema"? It is an introduction to
data modeling concepts and the SmartPlant meta schema. The SmartPlant schema is an
extensible framework for representing data, which is customizable by real-world users like
you.
The next stop on your journey towards understanding the SmartPlant schema is to try to
grasp the "patterns" that are buried in it (maybe like the novel The DaVinci Code).
Hexagon PPM wants you to be able to take the released SmartPlant schema and extend it to
meet your needs. We don't think that it's very difficult, but it's not exactly easy, either.
If you're the one who got "volunteered" to extend the schema, here's your chance to shine!
Schema-oriented tasks can be fun if you don't feel completely lost - and that's why this
book is here.
But enough of the abstract stuff -- when you need to do something with the SmartPlant
As in "A Gentle Introduction to the SmartPlant Schema", you'll see that some of the ideas
about the "patterns" are so good (or so hard to understand) that they are presented 2 or 3
times, in order to enhance your learning experience and turn the "Aha!" switch in your brain
to the "ON" position. After seeing a few patterns, processes and practices, you'll be ready
to tackle "your" schema problems.
One problem with this book is that it is "frozen in time", and if the underlying schema
changes, you might be confused about the examples here, vs. what you see in your copy of
the schema. If you're looking for insight into:
- What are the best practices for creating a data model?
- How can I incorporate my own equipment types?
- Which classes and relationships should I use?
- How does the schema really hang together?
...then this is the right place. You will find the patterns and philosophy used to build the
SmartPlant schema, hopefully, giving you a deeper understanding of how to make it work for
YOU.. Before you start, you probably want to read, with understanding, "A Gentle
Introduction to the SmartPlant Schema" and review the "jargon" that is associated with
this topic.
Disclaimer
I'm not an author, I'm a data architect. I intend to "lighten-up" the topic of the
SmartPlant schema patterns. I take this subject seriously, but I don't think that the
presentation has to be done in a serious manner. ;-}
This book is subtitled "Tales From A Modern-Day Super Modeler who Fights
Data Ambiguity with Powerful Data Modeling Tools.” It seems that all the superheroes were
busy this year, and, let's face it, it only takes a dedicated nerd to figure out this stuff, so
having muscles of steel hardly seems relevant (however, a red cape might be a nice touch).
So gather around the campfire and listen as Schema Man! spins his schema stories.
Introduction ................................................................................................................................................... i
SmartPlant Schema Overview.............................................................................................. i
How This Book is Organized ................................................................................................ i
Disclaimer ............................................................................................................................ ii
1 A Roadmap ................................................................................................................................................ 1
Patterns are Not Always Obvious ....................................................................................... 1
Why Learn Patterns? .......................................................................................................... 1
What's a "Practice"? ........................................................................................................... 2
A Process is a Set of Practices .......................................................................................... 2
2 Patterns ..................................................................................................................................................... 4
Introduction to Patterns ...................................................................................................... 4
The Origin of Anti-Patterns ................................................................................................. 6
Thinking about SmartPlant Schema Patterns .................................................................... 6
Explaining Patterns is Not Easy ......................................................................................... 6
Meta-Patterns: How to Express Design Patterns ............................................................... 8
Schema Pattern Levels ...................................................................................................... 9
The Meta-Pattern of This Book........................................................................................... 9
How to Use This Book ...................................................................................................... 10
SmartPlant Enterprise is a Framework ............................................................................. 10
Figure 1 A Building Foundation with Re-bar but Before Concrete is Poured ................. 7
Figure 2 Chess Pattern named "Giuoco Piano" ........................................................... 11
Figure 3 A Pump on a Simulation Drawing .................................................................. 14
Figure 4 ANSI Pump Dimensions ................................................................................. 15
Figure 5 A Sample UML Interface Pattern ................................................................... 17
Figure 6 A Sample UML Class Pattern ........................................................................ 19
Figure 7 Simple Relationship Pattern ........................................................................... 20
Figure 8 Relationships that a Pump may Participate in ............................................... 21
Figure 9 UML Diagram of Typical Property .................................................................. 26
Figure 10 PropertyDef Class Diagram ......................................................................... 26
Figure 11 IPropertyType UML Diagram ....................................................................... 30
Figure 12 Example of PropertyType Class Diagram (UML) ......................................... 30
Figure 13 Multi-level Enumerated List in Properties ..................................................... 33
Figure 14 Partial Equipment-Type Hierarchy ............................................................... 34
Figure 15 Sample Relationship Definition in Meta Schema ......................................... 37
Figure 16 Enumerated List Contains Values ................................................................ 37
Figure 17 Componentization Relation Definition UML Diagram ................................... 38
Figure 18 Componentization Relation Example ........................................................... 39
Figure 19 Contains Relation UML Diagram .................................................................. 39
Figure 20 Contains Relation Example .......................................................................... 39
Figure 21 EnumMetadata Relation UML Diagram ....................................................... 40
Figure 22 EnumMetadata Relation Example................................................................ 40
Figure 23 Nozzle Types ................................................................................................ 41
Figure 24 Exposes Relation UML Diagram .................................................................. 41
Figure 25 Exposes Relation Example .......................................................................... 42
Figure 26 HasDefaultSI Relation UML Diagram ........................................................... 42
Figure 27 HasDefaultSI Relation Example ................................................................... 42
Figure 28 Implies Relation UML Diagram .................................................................... 43
Figure 29 Implies Relation Example ............................................................................. 43
Figure 30 Instantiates Relation UML Diagram ............................................................. 43
Figure 31 Instantiates Relation Example ...................................................................... 44
Figure 32 ModelClass Relation UML Diagram ............................................................. 44
Figure 33 ModelClass Relation Example ..................................................................... 44
Figure 34 PrimaryInterface Relation UML Diagram ..................................................... 45
Figure 35 PrimaryInterface Relation Example.............................................................. 45
Figure 36 Realizes Relation UML Diagram .................................................................. 45
Figure 37 Realizes Relation Example .......................................................................... 46
Figure 38 ScopedBy Relation UML Diagram ............................................................... 46
Figure 39 ScopedBy Relation Example ........................................................................ 46
Figure 40 Sharing Relation UML Diagram ................................................................... 47
Figure 41 Sharing Relation Example ............................................................................ 47
Figure 42 UoMConditions Relation UML Diagram ....................................................... 48
Figure 43 UoMConditions Relation Example ............................................................... 48
Figure 44 A Bicycle, a Man Marries a Woman, a Compressor Spool has Nozzles ..... 52
Figure 45 Equipment Nozzles Relation Definition ........................................................ 53
Figure 46 Relation Definition Showing Inheritance ...................................................... 54
Figure 47 IRelDef UML Diagram .................................................................................. 56
Figure 48 RelDef Class Diagram .................................................................................. 56
Figure 49 Instrument Class .......................................................................................... 61
Figure 50 IClassDef UML Diagram............................................................................... 62
pattern she's observing. Later on, you look at that same thing and say "AHA!
That's just like a checker board (or a car, or a valve, or a pump)."
We all perceive patterns differently. In this book, I'll try to show the patterns in the
SmartPlant schema at a high-level, and at a low-level, so that you really gain a deeper
understanding of what's going on.
If it's OK with you, I'll mostly just say "schema" when I mean "SmartPlant schema" in the
rest of this book.
A practice does not address some huge problem. Rather, a practice attacks a specific
aspect of a problem. A practice is something that can be articulated and has a clear
beginning and end, and tells a complete story in understandable chunks. You'll see a bunch
of stories in this book, for that very reason. Hint: A practice leads to a goal.
A practice is a proven way of addressing a problem. It's something that's been done before
and can be repeatedly applied to the same problem to produce consistent results. It should
be noted that practices may be improved, and the new practice may be better, faster,
cheaper, or just more fun and less boring.
Review: One of the key elements to full integration is to have a "schema", and enforce some
kind of rules between a "publisher" and a "retriever" of data. It should be simple for two
different systems to talk about something that they have in common, for example, a motor,
a pump, a valve, and so on. But it is really not simple at all. That's because each program
has its own idea of what things are and how they are used. A "schema" is simply another
way of saying "a diagrammatic representation, an outline or a model."
I'll try to make your journey fun, but wait! I think I hear the familiar TV voice of Rod
Sterling saying: "That's the signpost up ahead -- your next stop: The Pattern Zone"!
After growling about data modeling for what seemed to be a long time, looked at
the large gathering and said: "This is like howling at the moon - the SmartPlant schema is
just not that hard to understand! It has a lot of patterns embedded within it that can help
you understand what's going on. In fact, its purpose in life is to make sure that multiple
software 'tools' adhere to patterns in order that they can exchange data in a meaningful
way." stood in the gathering (look at his legs: he can't sit) and listened as
Grey Wolf began the Story of Patterns.
Introduction to Patterns
Here is what Grady Booch, the Chief Scientist at Rational Software Corporation, says about
patterns:
As you'll see, SmartPlant Enterprise and the schema are loaded with many patterns, at many
levels.
"Novelists and playwrights rarely design their plots from scratch. Instead, they
follow patterns like 'Tragically Flawed Hero' (Macbeth, Hamlet, etc.) or 'The
Romantic Novel' (countless romance novels). In the same way, object-oriented
designers follow patterns like 'represent states with objects' and 'decorate objects
so that you can easily add/remove features.' Once you know the pattern, a lot of
design decisions follow automatically."
said that the principal benefit for using patterns is summed up in the word
"Reusability."
“After it sets, we erect the walls and install electrical wiring according to a Standard.
Finally, we put on the roof and coat it like this. We build all our houses like that."
says this: "The schema is extended by adding roles, properties of the roles, and
relationships between the roles. Enumerated lists may need to be extended, too. Then we
add classes and publish the result."
Pattern-Space
interrupts, "Well, it's great if you know how to pour a foundation, but
otherwise, you're going to be lost pretty quickly. You need to know what 'pourable thing' is
being discussed, and what does 'foundation' mean. Why in the world would you "pour" one?"
That's not a very big list of stuff, is it? puts on his best Zen-face and utters,
"True understanding of those terms is required in order for you to discover and use the
patterns in the schema. That will make your design decisions much easier!"
After taking a break, continues, "If you have the task of explaining the patterns
that are used in your world, how would you do that? I bet that you'd first develop a "meta-
pattern," or to say it another way, a 'pattern of patterns' - that's what this book does,
too."
Your Agenda
You, dear reader, need to learn how to think about patterns in your pattern-space. When
you're done with this book, you will feel confident about reading the schema, and updating it
with your own ideas of how your facility will be modeled in the schema.
Schema Patterns
Here are the patterns that will be covered by this book, and you may want to study them in
this order:
Basic patterns
• Interface definition pattern
• Property definition pattern
• Property type pattern
• Relation pattern
• Relation definition pattern
• Class definition pattern
• Edge definition pattern
• Graph definition pattern
• View definition pattern
• Shared Objects, Expansion, and SameAs pattern
Mid-level patterns
• Class/Interface/Property model
• Multi-level lists
Business patterns
• POSC/Caesar facility and material model
• Typical material vs. Planned material
• Component Schema Pattern (a basic pattern)
• Model Definition Pattern (a basic pattern)
• Collection Pattern
• Composition Pattern
• Connectivity Pattern
Furthermore, even the underlying framework can change. Look back at Windows 3.1 and
contrast that Windows XP Pro - you can see a vast change in the framework, and in the
architecture that it encompasses. Obviously, software is fragile, with respect to changes in
the operating system that it runs upon.
In chess, the opening game is different from the middle game, and that's different from
the end game. Each of those has well-known patterns.
Controlling the center of the board is a recurring pattern. Castling is a simple, but powerful
pattern. Figure 2 shows an opening pattern called Giuoco Piano, which is very common
"opening pattern", and you'll certainly encounter it if you play chess. There are thousands
of books on chess patterns, each of which promises to reveal some guarded secrets that
chess masters hope you'll never learn. The truth is chess masters only learn patterns. The
other truth is that most people get scared away from chess because they believe that "it's
too complicated."
The SmartPlant schema has very few "pieces" (interfaces, classes, lists), and not a lot of
"moves" (classes realize interfaces; interfaces expose properties, which are scoped by
types, and so on). There are innumerable ways that the basic pieces can be hooked together
into patterns that apply to designing and building a large facility. I hope you'll see some of
them are in this very fine book.
Don't let the fact that there are lots of patterns throw you for a loop, instead, try to
understand that these underlying design patterns are what allows you to exchange
intelligent data with a world of like-minded users. winks: "Some wolves chase
jack rabbits simply because they're fast."
is a drummer with the group "Bongo Morley and The Modelers", but his "day
job" is data modeling, which he learned from . Now, he's trying to explain to
the other band members, Hans (lead guitar), Dell (bass) and Deb (vocals), about patterns in
the SmartPlant schema. He says, "The heart of rock-and-roll is the beat, and the heart of
the SmartPlant schema is that objects expose their roles through abstract entities called
'interfaces'. Too bad Hans didn't read "A Gentle Introduction to the SmartPlant Schema",
because now he's wondering what the heck is going on. He keeps thinking that the relational
databases that he's used for the last 20 years are "good enough." Dell rolls his eyes and
Bongo laughs and says, "The Interface Definition Pattern shows how you can think about
creating new interfaces and utilize existing interfaces in an optimal manner." Hans silently
promises to read the Gentle Introduction book tonight, after band practice.
Identity
Interface Definition Pattern
Purpose
Define a standard way for objects to expose their roles to the universe.
"Now wait a second", Hans says, "I normalize my tables and create a data dictionary based
on third-normal form (3NF), so there isn't a problem at all!" "Well," Bongo replies, "You
might have a problem simply because data can be more normalized than 3NF. The
SmartPlant schema is mostly normalized to 5NF, which groups things by semantic meaning,
which is stronger than grouping by a key, like 3NF does. Try to concentrate for a minute.
Here is the technical definition of fifth-normal form (5NF):
Deb is starting to zone-out. Dell, well, we don't know about bass players, do we? Hans
seems to have some questions building up, but doesn't know how to ask them and not seem
stupid in front of his mates.
Bongo continues. "Hans, you're right in thinking that, usually, related attributes belong
together and that 3NF is usually enough. The need for 5NF becomes clear when you think
about inserts and deletes for records in multiple tables. If you perform entity-relationship
analysis, you'll see that you can optimize updates, and decrease the number of inserts into
some tables, which can mean important savings in time and space." By now, Dell is looking
like something out of time and space. Deb realizes that Dell is playing air bass, and she
recognizes the pattern of the song “Stairway to Heaven.” Hans realizes that he needs to
Google 5NF AND read the Gentle Introduction book. Man, this next week is going to be a
bummer! Bongo sees what's going on and concludes with "a table is in 5NF if it cannot have
a lossless decomposition into smaller tables." Deb is humming “Stairway to Heaven,” and
Hans is looking at his watch.
Bongo, the real leader of the band, tries again. "For example, you might have a property
named PumpColor in your pump table, because that makes sense and is valid to do in a 3NF
database. However, in the SmartPlant schema, all things that are ‘painted’ are isolated from
all things that are ‘pumps’ because the painted surface of the pump is not about ‘pump-ness,’
rather it is about ‘surface-coating-ness.’ That makes life easier from a couple of points of
view:
It is important to be able to think about the polymorphic nature of the objects that we're
working on during the holistic engineering design cycle. Suddenly, Deb wakes up: "Back up
there, - what is the meaning of 'a polymorphic pump'?" And Bongo, without
skipping a beat, says, "Here are some examples:"
- A pump is a requirement for increasing pressure in a pipe line (Figure 3)
- and so on
"Those are some of the ways that designers and engineers think of pumps, and that's surely
not a complete list. Some of the ideas are shared, and some of them are different,
depending on the engineering discipline involved. For example, the electrical engineer
probably doesn't care about the weight of the pump, but does care about the cable that can
be routed to the motor that drives the pump."
, who is a Phil Collins wannabe, does a little bada-bing on his drum! "THIS IS
REALLY IMPORTANT TO UNDERSTAND!" In the SmartPlant schema, polymorphism is
implemented via the Realizes relationship. When two classes "realize" the same interface,
they are said to be polymorphic with respect to that interface. That is, a client can make
early-bound calls to the properties (and, someday, methods) of the interface without having
to know the class of the object it's using. By creating standard role-based interfaces and
implementing them in multiple classes, the user can take advantage of polymorphism in the
tools that publish and retrieve data from SmartPlant Foundation. For example, a P&ID
pump, a 3D model pump, a PFD pump, and an Equipment data sheet pump all Realize the
IPump interface (in addition to whatever other interfaces they realize).
The schema uses abstract "interfaces" for data exchange. The reasons for doing that are:
- The separation of “signature” from “implementation”
- Polymorphism - Interfaces being associated with roles that are fulfilled by
classes
- Interfaces satisfying roles associated with relationships
- Interfaces being contracts that classes agree to support
- Flexibility of modeling that results from having classes implement interfaces -
what matters are the interfaces and not the classes
- Interfaces are immutable (can be depended on not to change)
Usage
"If you get just one point, get this", says, "Every time that you want to
communicate information about an object in a SmartPlant Enterprise tool, you start by
thinking of the roles that it exposes, the properties that can be exposed by that role, and
the relationships that it can form with other objects. The place that you store all that
information is in an interface, a property, a relationship, and so on, and all of them are
stored in the SmartPlant schema."
An InterfaceDef class is used by (or "Realized by") a "Class" to present the "roles" that the
class exposes to the world.
- An InterfaceDef is "Realized By" a ClassDef
- It exposes properties of the role (via "InterfaceDef Exposes PropertyDef")
- All InterfaceDef classes directly or indirectly "Imply" the Interface IObject
(IObject is for object identity)
The Interface Pattern is used extensively in all SmartPlant schema activities. As a pattern,
you will see that it is showing a main "role", and subordinate roles and parent roles - this is a
good pattern to learn.
As you can see from Figure 6, Class diagrams can be very messy. A class "realizes" that it
fulfills a lot of roles, and they all look like the previous graphic on a UML diagram. You can
see why we don't normally produce them, since it's hard to understand what's going on.
When you get to be a better data modeler, you'll understand why the guru said in "A Gentle
Introduction to the SmartPlant Schema" that class diagrams are just "inferred", once the
interface diagrams are complete.
It would be a very complex diagram, indeed, if we were to start showing all the possible
relationships in which, for example, a pump can participate, so let's forgo a UML diagram of
that and use a spreadsheet format instead. As you'll see in Figure 8, below, even that
contains a lot of data.
I’m sure you figured out that Figure 8 doesn't show all the relationships in which a Pump can
participate. The Relationship Pattern for Interfaces that are Realized by a Class might wind
up looking like that, simply because a UML diagram would be a useless plate of spaghetti.
Deeper Meaning
Look back at the Simple Relationship pattern (Figure 7). It illustrates a couple of good ways
to read and write relationships.
Look at the abstraction pattern (at the top and with the note {abstract}). Relationships
usually start out at a high-level of abstraction, and associate a couple of roles at that
abstract level. See if you understand this: there really isn't a first-class object
somewhere that is some kind of "parent", or "child", but we know that the idea that
many Parents have many Children is valid.
Notice that the Son and Daughter are each a type of Child. sees these
patterns:
o ISon Implies IChild (likely meaning: A Son is a type of Child)
o IDaughter Implies IChild (likely meaning: A Daughter is a type of Child)
o He is also thinking that there are two subtypes of IChild for a reason, and
assumes that the roles Son and Daughter are orthogonal to each other (meaning
that the role Son is not the same as the role Daughter).
Notice that there is a relationship between Son and Mother, namely, MotherSons, and a
different relationship between Daughter and Mother, namely, MotherDaughters, both
of which are specializations of the abstract relationship Children.
That's a lot of pattern knowledge that we got from such a simple diagram, don't you agree?
There are even more patterns "in there", but it is more complexity than you need (right
now). quips: "Do you see that a UML diagram is certainly worth 1.0E3
words?"
Collaborations
Interfaces represent abstract roles that classes of objects present to the universe.
Interfaces may carry properties, and may be related to other interfaces. Classes realize
that they fulfill roles.
Consequences
The Philosophy: "Roles, exposed by interfaces" is a powerful and flexible process for
classifying objects. It avoids the pitfalls of the Linnaean taxonomic model because
different classes of things can just yield up their roles to the universe by realizing that
they satisfy the requirements for that role. Got it? Bada-bing!
Implementation
Anti-Patterns
Here are some anti-patterns for the Interface Definition Pattern:
Interface names that don't begin with the letter "I" are incorrect. (it is a long-
standing practice, and better not to change it.)
o Refactor by changing the name to begin with "I."
Question why an interface is present in your model if it has no properties and no
relationships. Why should an object expose that role if nobody cares about it?
o Refactor by deleting the InterfaceDef until you are ready to use it.
If the properties on an interface are only loosely related, you probably don't have a
succinct role for the interface.
o Refactor by splitting out the properties into separate interfaces.
When adding new properties to the schema, look hard for an existing interface
before creating a new one. Take pity on the retriever of your data. If she sees an
interface for "painted things" and another interface for "things coated with paint",
what's she going to do?
o Refactoring idea: That's the deal about schema -- it's easy to plan for the
retriever upfront. Please try to avoid ambiguous schema concepts that are
"like" each other, but will confuse the retriever.
During a TV interview last week, told Channel 31's Carmen Diaz "One
of the two major functions of interfaces is to expose properties that belong to the
underlying object. For example, if there is an interface that expresses the role of 'a
rotating item', then you can expect that a property that carries the item's 'angular
velocity' is not far away." Carmen is wondering why thinks that's news.
Identity
Property Definition Pattern
During the interview, said: "Carmen, properties of an object are defined with
a PropertyDef. How properties get onto a particular interface is the subject of much
debate -- some people think that they just wander there, under the influence of a data
modeler who 'doesn't get it', and who is probably under the influence of an intoxicant.
Others claim that there is no rhyme or reason and clearly are frustrated that 'it's too hard
to find the properties that I'm looking for!'."
"The truth is that a good data modeler uses 'data normalization' to tightly-group related
properties and intentionally put them onto the interface that describes that precise set of
functionality. Around here, the data modelers assert that most interfaces are born from
an intentional act of data modeling, but some folks are waiting to hear confirmation of that
in your report on the 5:00 news."
Usage
Simple examples of properties are:
- Weight
- Length
- Color
- and so on
How do we decide where to put properties in the schema? First of all, properties don't
exist in thin air, they're "functionally grouped" and exposed by "interfaces" -- so we have
the first clue.
Next, think about what "interfaces" represent, namely, "abstract roles that classes of
objects present to the universe." To get a deeper understanding of the schema, think about
a "pump" and its properties, and to make it easier, spin ahead to pump roles (in §3.1.6). The
goal of data normalization is to group similar properties on "appropriate" interface. For
example, you expect to see properties about "how fast a pump rotates" on the
IRotatingItem interface, and properties about how much the pump weighs on the
IWeightItem interface. That's where the idea of "data normalization" comes in - it
answers the questions of how to properly group properties and put that group on an
interface.
Remember - the IWeightItem interface can expose other properties, for example:
Description of Pattern
"Right on, Carmen!" exclaimed. He knew that the news broadcast tonight
would be very different from the normal fare of war, gas price increases, and politics.
Collaborations
Properties are mapped to by SmartPlant Enterprise tools that want to publish or retrieve
data that matches the property. For example, a tool might want the weight of a pump, and
map their property named PumpWeight to the schema property named, for example,
Dry_Stripped_Weight.
Implementation
A property is defined by a PropertyDef. A property declares that it is a certain "type", via
the ScopedBy relationship. A property is exposed to the universe by an Exposes
relationship (from an interface).
Similar Patterns
N/A
Anti-Patterns
There is one very obscure anti-pattern relating to property definition: If you use a multi-
level list to scope a property, then you can't use the same mid-level EnumListLevelType to
scope two properties on the same interface.
Refactor to put those property definitions on different interfaces.
It was naptime, and was reading Aesop's Fables to his grandkids, Bill and
Laura, and apparently, "The Fox and Stork" were at it again - they couldn't agree on how to
drink soup, or eat dinner, or, most importantly, how to exchange data between their
software tools.
He told the kids: "The SmartPlant schema forces agreement on many issues between the
participants of the SmartPlant Enterprise. Here's the deal: if you want to be a conforming
SmartPlant Enterprise tool, you need to agree to a certain set of rules to make sure that
data ambiguity is eliminated (or minimized), and that other tools with whom you interact are
clear on the issue of what you will publish and what you expect to retrieve. Properties that
are exchanged between tools are restricted to agreed-upon types with this pattern."
Identity
Property Type Pattern
"Ha! Look at this picture, Bill", continued, "The Fox thinks that the length of
a ladder is measured in 'feet', and the Stork thinks that it is better to measure a ladder
using 'meters', so it's "Houston, we've got a problem!"
Bill and Laura were getting sleepy, so decides to sneak in an even worse
situation - he shines a flashlight up on his face and tells this scary story: "Once upon a time,
a fairy-tale creature thought that 'feet' was fine for measuring something, and another
creature, in the same story, thought that 'pounds per square inch' was the way to go. You
can imagine how that story ended! When tools participate in the SmartPlant Enterprise
solution, they must agree on the type (also known as ‘scope’) of a property before they can
publish or retrieve data. Otherwise, this would just be a fable about a Fox and a Stork!"
When says, "A property is scoped by a type," he means that both parties in a
data exchange know what "type" the data is before they publish and retrieve it.
Usage
There are several ways to classify (or "scope") properties:
- Simple types (also known as intrinsic types):
o Boolean
o Date & Time
o Double
o Integer
o Path (not currently used)
o String
o Year/Month/Day
- Enumerated values
- Enumerated lists of values, including multi-level lists
- Units of measure (a type of enumerated list of values)
Some of the types are 'internal', so we won't discuss them, but the rest are pretty easy to
understand.
Reading Figure 12 is pretty easy. What you need to understand is that the DoubleType
class will allow and disallow values that the user enters into the property field. The "Double
type" allows digits, a single decimal point, and so on. If you try to publish a value that has
the letter "Q" in it, the publish will fail because the letter "Q" is not allowed by the
DoubleType class.
If the Stork tries to publish the string "1.32", and the type is "integer", we know that's an
error, because the rule for integer scoping does not allow a decimal point.
The same deal is true for a "Boolean" field that we try to publish that has "GREEN" in it - it
will fail validation. Can you see how useful this is? The retriever of the data can have
confidence that what he retrieves is probably very good data, because you are going to have
a hard time publishing bad data!
Enumerated Values
Let's think about the common traffic control device called a "stop light." I bet that you
know what to do in each of these scenarios:
- Light is RED
- Light is YELLOW
- Light is GREEN
You already know that that's the entire set of values that you can use. Why not make life
on the publisher and retriever easy by making a list that just contains those values, and
then "scope" a property by that enumerated list?
Once again, you can see that if the schema can enforce that hierarchy, it is much easier for
the retrieving tools to act on whatever data they get (because a horizontal centrifugal pump
can't show up under the wrong branch of the hierarchy). Now, let's see how we can encode
that list of hierarchical values in a useful way.
What are the valid values for level-2 through level-7 of the hierarchy:
- For level-2, the set of values identified as {any value from level-2 of the
hierarchy}
- For level-3, the set of values identified as {any value from level-3 of the
hierarchy}
- and so on
Walking down the tree from the root to branch, to branch, finally to a leaf is easy to do by
the "publish" software, and makes it easy for the "retrieve" software to have confidence
that the values that it gets are correct.
Fire up the released schema (using the SmartPlant Schema Editor) and you can see all the
multi-level lists, and how they are used to scope properties.
Collaborations
"Scoping a property" is an important part of the schema, and an important part of the
overall strategy of making data that flows through the SmartPlant Enterprise accurate and
unambiguous. Because tools are "loosely integrated" to each other, it is especially important
for all tools to exchange properly scoped data. asserts: "Types make the data
trustworthy."
Implementation
When you are going to scope a property with a type, there are two basic approaches:
- If the property is scoped by an "intrinsic type", then just pick the appropriate
type from the Schema Editor
- If the property is scoped by an enumerated list, there are two sub-categories:
o Enumerated value list
If the list already exists, this is a no-brainer
If you need to create a new list, the Schema Editor allows you to
do that as a child process to the property-scoping user interface
o Multi-level enumerated value list
This is more complex because you need to plan out how many
levels there are in your multi-level list
Use an existing list or create a new one
Create a property for each level (PropertyDef)
If you create a new multi-level list, don't forget to create an
EnumListLevelType entry for each level from 2 to n. That is
what you will scope the appropriate property, at that level.
Similar Patterns
Units of measure lists are similar to enumerated value lists, and are, in fact, children of
enumerated lists.
Anti-Patterns
The Mars Climate Orbiter Spacecraft was lost because one NASA team used imperial units
while another used metric units for a key spacecraft operation. The confusion over units
was identified in preliminary findings by JPL's internal peer review. "People sometimes
make errors," said Dr. Edward Weiler, NASA's Associate Administrator for Space Science.
"The problem here was not the error, it was the failure of NASA's systems engineering, and
the checks and balances in our processes to detect the error. That's why we lost the
spacecraft." Did he mention that the parachute deployed at 3 times the height that it was
designed for, and the spacecraft crashed so badly that they've still not positively identified
the remains on the surface of Mars? To phrase it another way: "100,000 feet, 100,000
meters, who checks that at data interchange time? Why would anyone use anything other
than 'feet' as a length? "
Relation Pattern
The Relation Pattern is used to associate two schema objects to each other, following a
defined set of rules that are encoded in the meta schema. As we said before, a Class
Realizes Interfaces, which Expose properties that are Scoped by Types. Let's find out
what makes that phrase "operational."
Identity
Relation Pattern
Purpose
SmartPlant schema elements are related to each other in some way, via the Relation
Pattern. For example, classes are related to interfaces, which are related to properties,
which are related to types, and so on.
Usage
Schema elements are related to other schema elements using the Relation Pattern. Keep in
mind that we're not talking about relations that get "published" by a tool, rather, these
relationships are embedded within the schema, and are defined in the meta-schema. There
are 68 relationship definitions in the meta-schema Here are the most important ones:
- Componentization (§ 3.4.4.1)
- Contains (§ 3.4.4.2)
- EnumMetadata (§ 3.4.4.3)
- Exposes (§ 3.4.4.4)
- HasDefaultSI (§ 3.4.4.5)
- Implies (§ 3.4.4.6)
- Instantiates (§ 3.4.4.7)
- ModelClass (§ 3.4.4.8)
- PrimaryInterface (§ 3.4.4.9)
- Realizes (§ 3.4.4.10)
- ScopedBy (§ 3.4.4.11)
- Sharing (§ 3.4.4.12)
- UoMConditions (§ 3.4.4.13)
As we have said, the schema is defined by a meta-schema that has a built-in idea of how
relations between schema objects work. In other words, there is a built-in "relationship
definition" object (RelDef) in the meta-schema for each of the above-mentioned
relationship definitions.
"It shows a 'relationship definition' in the meta schema named 'Contains' which defines the
relationship between an object that exposes the role of being an enumerated list
(IEnumListType) and the objects that are the enumerated values that are in the
enumerated list (IEnumEnum). When you want to add an enumerated value to an enumerated
list, you will use the Contains relationship definition. When you do that, you will wind up with
a relationship between an enumerated list entry and an enumerated value, and that
relationship will have a stereotype of <<Contains>>."
Look at a sample UML diagram of an enumerated list that contains a couple of values:
<EnumListType>
<IObject UID="ACDC" Name="AC/DC""/>
</EnumListType>
<EnumEnum>
<IObject UID="UID_DC" Name="DC"/>
</EnumEnum>
<EnumEnum>
<IObject UID="UID_AC" Name="AC"/>
</EnumEnum>
<Rel>
<IObject UID="{8969062D}"/>
<IRel UID1="ACDC" UID2="UID_DC" DefUID="Contains"/>
</Rel>
<Rel>
<IObject UID="{F4A083DD}"/>
<IRel UID1="ACDC" UID2="UID_AC" DefUID="Contains"/>
</Rel>
In particular:
- Do you see how the stereotype <<Contains>> in the UML diagram wound up as
DefUID="Contains" in the schema file? That's how the schema and meta
schema elements are bound together
- Do you see how an instance of the relationship definition for "Contains" became
a relationship object (Rel), in the schema
Componentization
Section §3.7 contains a complete description of the Component Schema Pattern. In brief,
each class definition (ClassDef) must belong to 1 "component schema".
Component schemas are used to group classes so that the entire schema does not need to
be stored on every SmartPlant Enterprise client computer. Because the schema is large,
we're looking for a little optimization with this trick. For example, the SmartPlant P&ID
software probably doesn't need all the Smart 3D class definitions, because it won't use
them anyway.
That means that when you use the Schema Editor to generate a component schema file that
is based on "EquipDataSheet", the resulting file will contain all the classes that have the
"Componentization" relationship to "EquipDataSheet."
Contains
Enumerated lists (EnumListType) contain enumerated values (EnumEnum).
For example, the graphic below contains the "Pipe slope direction" enumerated list. Now
that you know what the meta schema looks like, see if the schema makes sense to you.
Figure 21 shows the basic relationship between an enumerated entry (IEnumEnum) and a
role named "IEnumMetdata", namely, the thing that enumerates it.
Which can be restated as INozzle can be "refined by" values in the Nozzle enumerated list,
which currently contains the values shown in Figure 23
So you see that a single INozzle interface can be further refined by supplying a nozzle
"type." Why bother? Well, some tools don't care about the type of a nozzle, but some do.
Whatever SmartPlant Enterprise tool "knows" the nozzle type is free to publish it, and from
then on, whoever retrieves it, has the data available.
Exposes
One of the most fundamental ideas in the schema is that an interface exposes properties.
If some item has "wet weight" and "dry weight", you should be thinking, "Look for those
weight properties on the IWeight interface." If an item loses pressure, you're thinking,
"Look for the pressure drop amount on IPressureDropItem", and so on. These little
factoids are due to the process of data normalization that was used to create schema
elements. When you can define the role that an item "yields up to the universe", you
automatically group relevant properties concerning that role, and place them together on
that role. Simply translated, that means that interfaces (roles) expose properties.
Figure 25 shows a few properties that are exposed by an interface. The rules of data
normalization control what properties are selected for that particular role.
HasDefaultSI
Every unit-of-measure list (UoMListType) has exactly one value that is defined to be the
"base" SI unit. Of course, the phrase "SI unit" refers to the International System of
Units, and is abbreviated by "SI".
For example, in the case of length, the SI unit is "meter"; for mass, it is "kilogram", and so
on.
Implies
An interface (defined by InterfaceDef) may imply other interfaces.
The extreme power of that simple statement lies in the underlying philosophy of using a
highly-normalized data model. An interface carries a tightly-defined "role", and you might
ask, "Why would one role need to imply another role?"
says that one interface implies another interface for one of two reasons:
- The implying interface (the child) is a "type of" the implied interface (the
parent). For example, IPump implies IFluidTransferMachine because a pump is a
type of fluid transfer machine.
- The implying interface (the child) requires the implied interface (the parent) in
order to fulfill its total role-ness in the universe. For example, you might think
that a control valve (IControlValve) results in the loss of pressure in a pipe line;
therefore, to accurately describe how a control valve realizes that it is a
pressure drop item (IPressureDropItem), you would expect the model to say
IControlValve Implies IPressureDropItem.
Instantiates
An object is created from a class definition (ClassDef) with a "class factory."
ModelClass
Each class (ClassDef) belongs to exactly one model (ModelDef). The idea of "models" is
from the POSC/Caesar concept of facility vs. material.
Primary Interface
Each class (ClassDef) must realize one "Primary Interface." A primary interface defines
the essential roles for an object.
You must understand this: The Primary Interface carries all the roles that the object is
capable of realizing. To state that a different way, the Primary Interface implies, either
directly or indirectly, all the interfaces that the object might be able to realize. Think
about it: that makes the Primary Interface like a fingerprint - it is unique in the universe.
Realizes
A class (defined by a ClassDef) realizes its roles with this relationship.
The "Primary Interface" (along with its implied interfaces) defines the "domain" of roles
(which roles an object may possibly yield up to the universe), but the Realizes relationship
defines the "range" of roles (those roles which are actually supported by an object). For
example, a Primary Interface IA might directly or indirectly imply IB and IC and ID (which
means IA might be a type of IB, IC or ID, or might require part of one of those roles to
complete its mission in life), but a tool is under no obligation to realize any of those roles
when it actually publishes an object (maybe a particular tool only cares that IA is a type of
IC, so it does not need to realize IB or ID).
The Realizes Relation Example shows a few of the interfaces that a class can Realize. By
now, you should be thinking, "a class is just a convenient way to group a bunch of roles
together and cause an object to come into existence, with those properties tagging right
along."
ScopedBy
A property (defined by PropertyDef) is scoped by a type (PropertyType). Please review
Property Type Pattern in §3.3 before reading this.
A property type must be (notice the cardinality of "1") thought out before you can publish
data, so that the retriever of the data doesn't have a big problem figuring out what you
meant.
Sharing gives SmartPlant Enterprise tools the ability to contribute to the data that is
published to the SmartPlant Enterprise database. This is particularly useful in a
collaborative engineering environment (where different engineering processes contribute
different properties to the objects that make up the final facility). For example, an
instrument is defined by many different tools, each of which has a partial idea about the
instrument, as they see it.
Like your kindergarten teacher told you: "Sharing is good." But which tools get to share
things? Let's say that the SmartPlant P&ID program publishes an instrument named
PIDInlineInstrument. First of all, an instrument appears on a P&ID drawing for a reason,
namely, someone plans to purchase it and install it. Therefore, an instrument that is
published by SmartPlant P&ID is in the "Planned Material" model (planned material = a plan
to purchase something). In the schema, the class PIDInstrument has a "Sharing"
relationship with SharedInstrument_PM, where "PM" stands for "Planned Material."
UoMConditions
A unit of measure list (defined by UoMListType) may have "conditions" that are required in
order to make the reading unambiguous. For example, a pressure gauge may have a readout
in "Gauge" or "Atmosphere", which differ by 14.7 psi. And if you think that's not important,
NASA would disagree (see anti-pattern).
Because of that little factoid, it is important to state, for example, "pressure conditions"
(meaning the conditions under which the reading is being taken), before publishing data, else
the retriever will have a heck of a time trying to figure out what was meant. And that
designer isn't getting paid to be a mind reader (oh, that's you - sorry).
An example of a published data file, using unit of measure with condition follows:
<PIDInlineInstrument>
<IObject UID="B168E6E8" Name="0D0-PV-7201"/>
...several lines omitted...
<IDesignConditions DesignPressMax="5 barg @Gauge"/>
Because of that "@Gauge" identifier, I bet the retriever now knows exactly what the "5"
- Componentization (§ 3.4.4.1)
- Contains (§ 3.4.4.2)
- EnumMetadata (§ 3.4.4.3)
- Exposes (§ 3.4.4.4)
- HasDefaultSI (§ 3.4.4.5)
- Implies (§ 3.4.4.6)
- Instantiates (§ 3.4.4.7)
- ModelClass (§ 3.4.4.8)
- PrimaryInterface (§ 3.4.4.9)
- Realizes (§ 3.4.4.10)
- ScopedBy (§ 3.4.4.11)
- Sharing (§ 3.4.4.12)
- UoMConditions (§ 3.4.4.13)
Description of Pattern
The Relation Pattern associates two schema elements to each other. Quite possibly, you're
not used to explicit relationships between schema elements. For example, if you're used to
working with a database, you don't think much of how a class and its properties are related,
relying instead on a data dictionary and the built-in SQL query facility to make all that
happen.
However, the SmartPlant schema is a 'living' schema, and it changes and evolves over time.
One of the most powerful things about the SmartPlant schema is the ability for the schema
to evolve, and for the tool users to know how schema evolution will impact them. By having
explicit relationships between the different schema elements, it becomes a manageable
problem to communicate to tools 'what changes have taken place since last time I got a
schema?'. Using the schema component, one schema can be compared with another schema,
and a set of 'instructions' is generated that clearly states what changes happened. Because
every relationship between every schema element is a first-class object, with its own UID,
it is very easy to track changes, additions, and deletions that have happened.
Consequences
Using the Relation Pattern is an essential part of schema development. ALL schema
elements are related to other schema elements via a Relation.
Implementation
How should the data modeler and the tool developer view the Relation Pattern? It is so
fundamental to the schema, and to published and retrieved data, that it is clearly a building
block that can't be over-emphasized in importance. You must understand the idea of a
Relationship in order to succeed! For example, you are related to your mother. In your role
as a data modeler, you should be able to "abstract" that idea to the idea that any child has a
mother, then any child has parents, then any item may have zero or more parents. When
you develop or use the SmartPlant schema, you will see that the most common schema
element is the Relationship.
Similar Patterns
N/A
Anti-Patterns
Gauge vs. Absolute pressure became an issue in January 1967, when Roger Chaffee, Virgil
Grissom, and Edward White were killed at Cape Kennedy during a training exercise for the
Apollo 1 mission. The crew died as a result of a fire within the spacecraft cabin. The flash
fire occurred in command module 012 during a launch pad test of the Apollo/Saturn space
vehicle being prepared for the first piloted flight. The investigation pinpointed the cause
and made specific recommendations that led to major design and engineering modifications
and revisions to test planning, test discipline, manufacturing processes and procedures, and
quality control.
One of the main findings was that the test was conducted with a 16.7 pounds per square
inch absolute, 100-percent oxygen atmosphere (which was ignited by electrical arcing).
"The crew was never capable of effecting emergency egress because of the pressurization
before rupture and their lack of consciousness soon after the rupture." Author's note: the
test pressure should have been 5 psi absolute, which is actually LESS THAN atmospheric
pressure by quite a bit!
Objects expose their roles through abstract entities called "interfaces." Relation
definitions are used to define the association between two interfaces. A relation definition
is one of the most complex structures in the schema, and you really need to be on your toes
when creating new ones, or trying to interpret existing ones. Some of the complexity comes
from:
- Lots of properties on a Relation Definition (RelDef) (because it actually is a
complex structure)
- Intense concentration is required to think about several levels of what's being
expressed:
o The Relation Definition itself, as a schema element (RelDef)
o How it will be instantiated in a published document (as a Rel)
o How it will be used by tools to relate objects
o How its rules will be enforced by SmartPlant Foundation
warns: "Some ideas are simple and easy, for example, how to turn on a light
switch. Some ideas are simple, but not easy, for example, how is the circumference of a
circle related to the diameter. This topic is not simple and it's not easy." So go grab a
cuppa' Joe and stay alert!
Identity
Relation Definition Pattern
Purpose
Forming relationships between objects is very common in the world around us. Let's discuss
two important ideas about relationships:
- How do we define a relationship between objects?
o Abstract relationships
o Concrete relationships
- How does a tool publish a defined relationship?
We're thinking of a bicycle and its wheels, a husband and his wife, a compressor spool and
its nozzles. With respect to the schema, we're thinking of how to define those
relationships so that those ideas can be correctly and unambiguously published and
retrieved by SmartPlant Enterprise tools.
Thinking of "Relations", they are defined in a similar manner, for example, marriage belongs
to a "class of relations" between men and women. Other "class of relations" members might
include mothers and sons, brothers and sisters, and so on, and they all have something in
common, so we group them as "class of relations between men and women."
Now that we've done some preliminary systems analysis, we're ready to put the new
relationship definition into the schema, right? Wrong-o! Now, we're ready to look for
something that is already in the schema that is similar to what we're about to add and use
it, if possible.
Figure 45 directly relates equipment and nozzles, but it has a "parent" Relation Definition -
EquipmentComponents, so the whole thing looks like this:
Usage
The Relation Definition (RelDef) that you specify in the schema is enforced when you
publish a document that contains a relationship (Rel) between two objects. Recall that a
relationship (Rel) is simply an instance of a relationship definition (RelDef).
pushes up his glasses and says: "There seems to be an awful lot of properties
on a relationship definition, and it will take you a while to understand them all, but be
patient and you will succeed."
As you saw in Figure 46, some Relation Definitions are specializations of other Relation
Definitions, so you need to know:
- Is this an "abstract” or "standard" relationship?
- Is this a "specialization" of another Relation Definition?
- Ties into hierarchy defined by relationship definition
Certain rules can be defined and enforced by the SmartPlant Foundation software (which
runs at the heart of the SmartPlant Enterprise), that is:
- Delete behavior
- Copy behavior for object 1 or 2
o Copy object at end 2 or 1
o Copy relationship to object at end 2 or 1
o Don't copy object or relationship
- Do we need to publish objects on both sides of a relationship now, or can the
other side wait until later?
Collaborations
Relationship Definitions are used to spawn Relationships. The RelDef contains the rules for
how the Relationship is supposed to interact with the world.
Consequences
If you use the Relationship Definition pattern, the result will be a well-defined hierarchy of
abstract and concrete relationships that can be published by one tool and retrieved by
another tool. Remember: it is very important to think about the retriever of the data -- any
ambiguity in the SmartPlant schema makes it very difficult for the poor woman who's
writing the retrieval logic to figure out what relationship you're talking about.
Implementation
Because there are exactly two ends to a relationship definition, pick one and relate it to the
other. Over time, we have evolved the idea that picking the "many" side first seems to be a
good pattern.
Similar Patterns
Collection Pattern
Composition Pattern
Anti-Patterns
N/A
In general, you need to know that an object, for example, pump P-101, that you publish into
the SmartPlant database is an "instance of a class", which was defined by a class definition
(ClassDef) in the schema.
says, "A cow is an instance of a mammal." That's the basis of the Class
Definition Pattern. "Listen up", he says, "first, you have to define what a mammal 'is' by
figuring out its mammal-ness. Then you create one - poof! - the mammal that just got
created is called an 'instance of a mammal'."
- Author's note 1: Google 'mammal', or ask the nearby zoologist to find out what
mammal-ness is.
- Author's note 2: you may find that it is somewhat difficult to create one
('poof!' is really not so easy to do), and you should probably rely on a More
Powerful Being to do that.
For now, let's stick with what we can do, namely, define a class.
Identity
Class Definition Pattern
Purpose
If you have a SmartPlant tool, for example, SmartPlant P&ID, SmartPlant Electrical, Smart
3D, and so on, and you're ready to start publishing your "stuff", what do you need to do?
- Define the roles that your tool will publish (create InterfaceDefs)
- Optionally define the properties on those roles (PropertyDef)
- Optionally create associations between the roles (RelDef)
- Do some mapping between your stuff and the SmartPlant stuff
- Publish something? Wait a minute! - back in §3.1, you said "The most
fundamental idea of the SmartPlant schema is that objects expose their roles
through abstract entities called "interfaces." But you can't publish abstract
entities!
Uh oh, you got me. You need a way to stitch together all those abstract entities and publish
that stitched-together thing, in a container called a document. The thing that binds roles
together is called a class; it groups similar things, it is the creator of "objects", and it's
defined by a ClassDef.
In the case of "mammal-ness", scientists have decided that some of the characteristics
that bind mammals together into a class are:
- warm-blooded (endothermic)
- vertebrate (has a backbone)
- grows hair on its skin
- (in females) produces milk for its young
- has internal fertilization
- breathes air
- gives live birth (does not lay eggs and incubate them)
As you know by now, we would probably take each of those "roles", for example, 'breathes
air', and create abstract interfaces (IBreathesAir) to expose those roles (and properties)
to the universe. As you know, not everything that, for example, 'breathes air' is a mammal,
so that particular interface, or role, may also be realized by, for example, a crocodile, which
is a reptile. A crocodile has a backbone, so it has some of the characteristics of a mammal,
for example, has legs, eyes, a beating heart, and lots of other characteristics that it shares
with mammals - but it is not a mammal, for example, it "lays eggs", and is "cold-blooded." It
is "hairless" and does not "produce milk for its young."
So the secret of classifying 'mammals' as different from 'reptiles' is that one class has a
certain set of roles, and a different class has a different set of roles - even if some of the
roles overlap! Here's something weird for you to think about: so-called 'hairs' like you have
on your head (trichomes) are also found on plants. So classes as diverse as thistles and
humans have at least one common role! Author's question: do plants 'breathe air'??
At the end of the thought process about "mammal-ness", some significant difference exists,
for example, "gives live-birth" vs. "lays eggs and incubates them" is a significant enough
difference that scientists have different classes for mammals than reptiles.
Let's summarize our thoughts on interfaces and classes - interfaces carry role-ness, classes
realize that they expose those roles to the universe.
Usage
If you start thinking about your tool's data, and what great chunks of useful wisdom you can
share with the rest of the collaborative engineering process team (by publishing it to the
SmartPlant Enterprise), you should think like this:
- My tool (a software program) deals with instruments that are used to monitor
the conditions of a pipe line.
- Which means that you need to publish "instrument things" and "pipe line things"
- Which means that you need an "instrument class" to group instrument roles and
properties
- And a "pipe line class" to group pipe line roles and properties.
has a little helper for you -- how you can picture interfaces and properties in
an easy-to-understand manner. First, look at a UML diagram of an instrument class
(PIDInstrument) definition:
As you can tell, it is far too complex to understand, and if the UML diagram showed all of
the properties that are exposed by those interfaces, it would be a real mess (however, you
must admit that it may have some artistic value). In the center of the diagram is a class
definition (ClassDef), which represents an instrument that is shown on a P&ID, namely,
PIDInstrument. Each of the circles, at the end of a dashed line (also known as a lollipop) is
a UML representation of an interface (InterfaceDef) (see §3.1) that the PIDInstrument
class yields up to the universe (Realizes that it is). In fact, a simple trick for reading the
diagram is to say "a PIDInstrumentClass realizes that it is (or may be) an 'oriented item'
(IOrientedItem)", and so on.
Holy smokes! That's complicated! What's going on? First of all, what matters to you (as
the owner of a tool that is about to publish an object that is defined by a ClassDef ) is:
- IMappableClass - This lets you do "mapping" between the class, and whatever is
your tool's equivalent
- The relationship between IClassDef and IInterfaceDef is obviously mighty
important - it's our friend, the "Realizes" relationship, and it lets a class realize
what roles it yields up to the universe
- ICompSchema - what component schema the class is tied to, and consequently,
what objects (that are based on that class) it can publish
- ISharedObjDef - Lets two tools "share" objects
- IModelDef - what "model" the class is tied to
- IDocumentType - the "document type"
There's nothing very interesting here, except the IMappableClass interface, which lets you
map a class to whatever is your equivalent.
Description of Pattern
A class of objects refers to a collection of things that share a common attribute (picture a
class of objects called 'song birds' and you're done). The process of classifying things
involves arranging them by classes or categories. Once you have identified and categorized
something, the schema mechanism for storing the information about the class is the
ClassDef. The ClassDef lets you express the roles that the class exposes to the universe.
When you publish a document, you include "instances of classes", which are called "objects."
Each object has, at a minimum, identity. It may also have any properties that it is
authorized to express. That authorization comes from this great cross-stitch pattern that
you can use for your next project with the group:
(I hope that my wife doesn't notice her cross-stitch software being used like this). So
think about it this way: you define a class, you define some interfaces, you define some
properties, you publish a document that contains your objects that are defined in the
schema to behave a certain way. It's that simple! The SmartPlant Enterprise suite takes
care of a lot of the underlying "enforcement", including validating your published file against
the schema.
Collaborations
ClassDef has several important collaborations that you need to understand:
- Mapping - lets you create external relationships (maps) between the things in
your world that looks like classes to corresponding schema stuff
Consequences
Classes are defined using the Class Definition Pattern. Objects, based on those class
definitions, are published to a document and stored in the SmartPlant Foundation database.
Implementation
In the schema, class names are generally based on the tool that creates them. For example,
classes that are published by the Equipment Datasheet generally begin with 'EQD'.
However, if some other tool wants to publish a class that's just like an EQDPump, that's
perfectly OK.
Similar Patterns
Classes and interfaces are widely accepted structures in the Microsoft Component Object
Model (COM). COM is a software architecture that allows applications to be built from
binary software components. COM is the underlying architecture for all current Microsoft
software, so you could say that it's an idea whose time has come. The most fundamental
problem that COM solves is: How can a system be designed so that binary executables from
different vendors, written in different parts of the world, and at different times, are able
to interoperate? The ClassDef, and InterfaceDef are structures in the SmartPlant schema
that answer the question: How can data from multiple software programs, operating in a
collaborative engineering environment share data. The more you know about COM, the more
you'll agree that it really solves the interoperability problem of binary software
components. We think that the SmartPlant schema and schema components provide the
same level of functionality for arbitrary shared data. See §4.6 for more information on
"shared objects."
Identity
Component Schema Pattern
Purpose
"Component schemas" are used to group classes (ClassDef) so that the entire SmartPlant
schema does not need to be stored on every SmartPlant Enterprise client computer. Why
does that matter?
The schema is quite large and we're looking for a little optimization with this pattern. For
example, the SmartPlant P&ID software doesn't need all the Smart 3D class definitions,
because it won't use them anyway. For example, a P&ID drawing has no clue about what a
P3DCableTrayPort is. A P&ID (piping and instrumentation diagram) is a schematic
representation and Smart 3D is a higher-level 3-D representation. Some concepts are
shared between those tools, and some are not.
Many sets of tools work that way, that is, they don't have the same "domain of discourse."
But when all their outputs are combined, a total picture of the facility is created in the
SmartPlant Foundation database - and that's the ultimate goal of SmartPlant Foundation,
that is, gather up information from many different sources and combine it all in a
meaningful way.
Usage
Here is a list of component schemas that are built into the schema:
- ControlSystemComponent - groups of classes that have to do with control
systems
- DimensionalDatasheetComponent - groups of classes that have to do with things
that appear on a "dimensional data sheet"
- DocVersioningComponent - groups of classes that have to do with document
versions and revisions
- ELEComponent - electrical components
- EQLComponent - things on an equipment list
- EquipDataSheet - things on an equipment data sheet
- GenericDocumentComponent - things that are documents
- IMLComponent - things on an instrument master list
- InstrumentIndexComponent - things that are on an instrument index
- MetaSchema - internal use only
- P3DComponent - things that are on a 3D drawing
- PBSComponent - the plant breakdown structure
- PDSComponent - things that are used by Plant Design System
- PFDComponent - things on a Piping Flow diagram
- PIDComponent - things on a Piping & Instrumentation diagram
- ProcessDataComponent - things that are involved in the process data model
- WBSComponent - the work breakdown structure
It's no big deal - component schemas simply break the total schema into smaller, more
manageable pieces.
For this example, the Schema Editor will generate a "component schema file" that is based
on ControlSystemComponent, which contains (only) those classes, plus their interfaces, plus
their properties, plus their scoping, plus enumerated lists. That file is much smaller than
the entire schema, so it will parse and load faster by the tool that is publishing data to
SmartPlant Foundation.
Description of Pattern
Think about how your tool publishes data: your tool invokes a piece of code called an
"adapter" which reads a "map" that translates your objects into SmartPlant objects, which
are then published as a document into the SmartPlant Foundation database.
It was decided, early on, that it is not very efficient to force each tool to load all the
classes during the publish phase because it is just too time-consuming for the adapter to
parse the entire schema file. Therefore, class definitions are grouped together by a
something called a "component schema". The Schema Editor creates these groups of
"component schemas", each of which contains a certain subgroup of all the possible classes.
Then, individual tools only have to know about that subgroup of classes, which is more
efficient.
Collaborations
The Schema Editor breaks apart the "total" schema file into a bunch of smaller files, called
"component schema" files. Each file is a collection of class definitions that are probably
going to be published by the same tool, although that is not a requirement.
Consequences
A small collection of class definitions, along with required supporting definitions, is quicker
to parse and load than forcing each tool to read and parse the entire SmartPlant schema,
each time that a "publish" program is run.
Implementation
When you define a new class definition (ClassDef) in the Schema Editor, you will need to
choose a component schema that the new class belongs to. That shouldn't be rocket
science, because it is obvious which tool is publishing the class, so you either pick an existing
component schema, or create a new one - if your new classes don't fit into one of the
existing component schema categories - just fire up the trusty Schema Editor and add a
new one.
Similar Patterns
Composition Pattern
Anti-Patterns
N/A
Identity
Model Definition Pattern
Purpose
"Models" are used to break your tool's classes apart into some kind of high-level functional
groups. At the highest level, a class is either "facility" or "material", depending on whether
it is an abstract- or concrete role. Then the facility model and material model are further
sub-divided into more convenient groups and so on. These groups are based on the
POSC/Caesar model.
Usage
Here is a list of model definitions that are built into the schema:
- ActualMaterialModel - represents actual material items (they usually have a
serial number)
- FacilityModel - represents the abstract items that are in the concept-phase of
design
- PlannedMaterialModel - represents items that we plan to purchase
- TypicalMaterialModel - represents "typical" items, for example, a typical
computer is what you'd find in a specific manufacturer’s computer catalog
- WorkBreakdownModel - having to do with items in the work breakdown
structure (WBS)
Some technical description of a model definition would say that each of these are instances
of the ModelDef class, but that might confuse some readers, so I'll try not to put that in
this document.
Description of Pattern
Every object that gets published is an instance of a class, which is defined by a ClassDef.
Each ClassDef must be associated to a model (ModelDef). Therefore, you can figure out
that objects will be grouped by model.
Collaborations
The idea of "models" is really about "shared objects", which is discussed in §4.6. Objects
within a model share data in a different way than objects that are in different models.
Consequences
N/A
Implementation
When you define a new class definition (ClassDef) in the Schema Editor, you will need to
choose a "model" that the new class belongs to. How do you do that? Well, if you're going
to buy an instance of the object, for example, a pump, then you're probably talking about
planned material. If you're thinking about an item in a catalog, it's probably typical
material, and so on.
Similar Patterns
Composition Pattern
Now that you have a good understanding of the basic elements of the schema, here are
some useful patterns for combining them to provide some powerful functionality in a
collaborative engineering environment.
Class/Interface/Property Pattern
As you saw in the lovely cross-stitch pattern in Figure 52, Classes Realize Interfaces that
Expose Properties, which are Scoped by types.
Identity
Class/Interface/Property Pattern
Purpose
Probably, the most common thing that you will do is add your own classes, interfaces, and
properties to the schema. There is proper a way to do that. And there is a reason for
doing that - the stuff that you want to share with other members of your collaborative
engineering group may not be in the schema, so you have to know how to extend your
schema.
Usage
There are two possible starting points:
- Find a similar class definition, and clone it. For example, if you're going to
publish a vertical centrifugal pump and you see a horizontal centrifugal pump in
the schema, it may save you some time.
- Plan 'B': Make an entirely new class definition from scratch. If you're sure that
nothing similar exists, go ahead and make your own class.
Let's go through an example of making an entirely new class definition from scratch,
because then you'll see the whole process.
We're on a roll, now! What are the other roles that a mammal yields up to the universe?
(you should look back at §3.6.2 to find out).
Now, let’s add some properties to one of the interfaces and "scope" the property with an
enumerated list that contains a couple of values:
As you recall, an instance of a ClassDef is an object, so you can now start publishing
instances of the aMammal class from your collaborative engineering tool. Congratulations!
(NOTE: There are actually a few more boring details, like mapping, and hooking up to the
SmartPlant adapter.)
Description of Pattern
Classes Realize Interfaces that Expose Properties. That should be embedded in your brain
by now; if not, please look back to Figure 52 at this time for a review of the (cross-stitch)
pattern (get it?).
Consequences
You create interfaces for the purpose of yielding up roles. Interfaces are purely imaginary.
They are used to tightly-group semantically-related concepts. You add properties to the
interfaces. You add classes that realize that they need some of those roles to be complete
in the universe. You publish instances of classes (called objects). The consequences of
adding classes, interfaces and properties to the schema is so that you can publish your data.
If you are a new user who has some stuff to contribute to the collaborative engineering
process, here's how to do it. It's an easy pattern to follow: express roles, then define
classes, and it should not take long to make a bunch of your stuff available to your fellow
collaborators.
Implementation
Use the Schema Editor to add the roles (InterfaceDef), properties, and classes. Be careful
that you don't add stuff that's already there.
You don't need to be a computer scientist to figure out that your idea of, for example, "a
horizontal pump" is the same as the schema idea of IOrientedItem, but you need to stay on
your toes - anything that you put into the schema that contributes to ambiguity will make
the schema too hard to use.
Similar Patterns
In the "database-oriented world", classes carry properties directly, and are related to
other classes. As we have discussed, the Class, Interface, Property model is simply a
better way of doing things.
ambiguity,; therefore, will probably show up when you least expect it, and he
may slap you silly!
Identity
Multi-level List Pattern
Purpose
A multi-level enumerated list of values is populated with a hierarchy (or a tree) of values.
Each child has exactly one parent. This is a common idea in the real world.
Usage
Take a minute and review §3.3.6.2 Multi-level Enumerated Lists. What you see is that each
level of a multi-level list scopes a separate property on an interface.
Hierarchical Levels
While the topmost node and each of the branch nodes in an enumerated list hierarchy are
enumerated lists, the requirement exists to treat all of the enumerated lists and
enumerated entries at a given hierarchical level as an enumerated list.
In the following hierarchy, the topmost node is A. The second level in the hierarchy
consists of three nodes: A.1, A.2 and A.3. These enumerated lists are the enumerated
entries for enumerated list A. Enumerated list A.1 contains enumerated entries A.1.1 and
A.1.2, enumerated list A.2 contains enumerated entries A.2.1, A.2.2 and A.2.3 and
enumerated list A.3 contains enumerated entries A.3.1 and A.3.2.
Enumerated list A could be the property type for property TypeOfA, enumerated list A.1
could be the property type for property TypeOfA.1, enumerated list A.2 could be the
property type for property TypeIOfA.2 and enumerated list A.3 could be the property type
for property TypeOfA.3.
The requirement to treat entire levels of a hierarchy as a property type rather than
treating each of the branch nodes as a property type is a common one. Many tools do not
deal with the specialized role (interface) that would expose the specific property
associated with a branch node; instead, they deal with just an overall type definition. For
example, many tools may want to type an equipment object as a centrifugal pump but far
fewer tools would want to support the pump role (IPump interface) associated with this
branch node. Therefore, most tools would want EquipmentType1, EquipmentType2 (that is,
EquipmentSubtype), and so on properties rather than the more specific EquipmentType,
MaterialHandlingEquipmentType, FluidTransferMachineType, PumpType, and so on
properties.
One of the class definitions that supports IEnumMetadata is InterfaceDef. This means
that an enumerated entry (or enumerated list that supports IEnumEnum) can have an
<<EnumMetadata>> relationship to an interface definition that defines additional properties
and behavior for that enumerated entry. For example, the "Pump" enumerated list could
have an <<EnumMetadata>> relationship to IPump, which would then define additional
properties and behavior common to pumps.
Because the various nodes in the type specialization hierarchy can have corresponding roles
(interface definitions), the type specialization can have a corresponding role specialization.
For the type specialization, each node in the enumerated list hierarchy would have a
Contains relationship to its more generalized parent, whereas the corresponding role
specialization would have similar Implies relationships between the interface definitions.
The interface definition involved in the <<EnumMetadata>> relationship will normally have
(unless it corresponds to a leaf node) an exposed property definition that is scoped by the
related enumerated list. Figure 66 shows, for example, IPump exposes a property
PumpType that is scoped by the Pump enumerated list
Description of Pattern
The Multi-level List Pattern lets you build up a hierarchical list of values (a hierarchical list
is like a tree). Entries in the list are connected by parent-child relationships. We covered
this in detail in §3.3.6.2 Multi-level Enumerated Lists.
Collaborations
Enumerated lists (EnumListType) may have optional "levels" (EnumListLevelType) and
probably have enumerated values (EnumEnum) at every node of the tree. If you have a list
of values that you want to share with another engineering tool, putting it into an
enumerated list is probably a good way to ensure that you will both be talking about the
same stuff.
Consequences
Sharing multi-level enumerated lists is a powerful idea for the collaborative design process.
A tool like a piping flow diagram (PFD), or a piping and instrumentation diagram (P&ID) is
used in early-stage design. Tools like Smart 3D takes the output of a PFD or P&ID and
enhances (embellishes) the objects that they published to come up with a late-stage, detail
design.
But, think of a "vertical, centrifugal pump" for a minute. The fact is that the early-stage
design tools don't have a clue about such a detailed entity - they may only have the concept
of "an equipment that increases pressure in a pipe line." For sure, the Smart 3D program
knows a lot about a vertical, centrifugal pump, and, of course, a pump catalog, or an
equipment data sheet that describes a pump to a fare-thee-well. The idea of a multi-level
enumerated list helps each of these tools share data about, for example, pumps. Early tools
know that it's an equipment ... later tools know that it has dimensions ... later tools know
where it will be placed in 3-space and so on.
It all goes back to the discussion of polymorphism - a polymorphic pump has different roles
that different tools contribute to the overall "shared" idea of a pump. In the case of
equipment, there is a 7-level hierarchy that defines "everything kind of equipment." With
apologies to E.A. Poe:
Implementation
So how do you build a practical multi-level list? It's not so easy, because there are a lot of
steps involved:
- Create and populate the enumerated list - remember that an enumerated list
(EnumListType) can contain other enumerated lists or enumerated values
(EnumEnum)
o Create property definitions - make sure that you are on the correct
interface!
Scope the property definitions with the enumerated lists or
enumerated values
• Create the links between the hierarchical levels of the
lists (EnumListLevelType)
How do you implement the multi-level list? Let's make a list of cars, grouped by
manufacturer:
Ford
- Mustang
o GT
Shelby GT
- 500
o Coupe
o Sedan
Let's add the level2, 3, and 4 relationships (EnumListLevelType) to the schema, and see
what we've cooked up:
AutoMfr2 is the level 2 enumerated list level type and so on. Do you remember what the
enumerated list level types are for? When you scope a property by an EnumListLevelType,
you are telling the publishing program that it's OK to publish a selection from that
particular "level" of the list. Think about that for a second:
- What values are at level 1 of this list?
o {Chevrolet; Chrysler; Ford; Honda}
- What values are at level 2 of this list?
o {Corvette; Malibu; PT Cruiser; 300; Accord; Civic; 500; Mustang}
Do you get it? What is a valid value that you can publish for property 1 (AutoMfr1)?
- Pick one from this list {Chevrolet; Chrysler; Ford; Honda}
Now, based on that choice, the values from level 2 (AutoMfr2) are constrained to 2 rules:
1. The choice must be in the level 2 list, and
2. The choice must be in the children of the level 1 list
Which means, for example, Chevrolet -> Corvette is a valid choice (if you can afford it), but
Honda -> 500 is invalid, because '500' is valid level 2 entry, but is not a child of the 'Honda'
hierarchy
In summary, it's done this way so that early-stage programs that only know about, for
example, 'Ford' can go ahead and publish something, but subsequent programs know about
'Mustang', and the 'GT' variant, and the 'Shelby' variant of that are OK to increase the
level of detail that is published.
Just the other day I thought I heard say: "Let's talk about how
enumerated list values tie to interfaces."
Figure 71 Interfaces
Figure 71 shows the interface hierarchy that we're talking about, that is, types of
automobiles. And Figure 72, below, shows a tie between an interface hierarchy and an
enumerated list hierarchy
Hey there, are you still awake after the commercial break? Did you see that little trick of
Here is the overall picture of auto manufacturers and automobiles, nicely tied together.
Anti-Patterns
When we were creating the schema, we tried to make enumerated lists "well-behaved", and
they looked like this:
1. List 'x'
a. enumerated value 'ax'
b. enumerated value 'bx'
c.
2. List 'y'
a. enumerated value 'ay'
b. enumerated value 'by'
3. and so on
But we got complaints from users who wanted to add new values between 'x' and 'y', plus
some values between 'ay' and 'by', too. So the nice, clean pattern does not appear to be
totally applicable to all enumerated lists.
(With apologies to L. Frank Baum). Once upon a time, in the land of SmartPlant (on the far-
far-outskirts of Oz), Dorothy said "Edges, and graphs and views, O My!" She was concerned
that complex ideas like that would scare the Scarecrow (he pretended to be brainless, but
she knew better). Because he was a friend (but mostly because he looked a lot like
, whom her girlfriend told her was a Super Model, and didn't quite understand
that he really is a Super Modeler, but that's a different story) she sat down by a brick road
(whose color is an enumerated value equal to "Yellow") and began to explain...
"An 'edge' is simply a mechanism to set up navigation across one or more relationships with
optional filtering of the objects returned. Edges are especially useful for ad hoc reporting.
Edges are defined with an EdgeDef." Dorothy picked up a stick and scratched this diagram
into the dust, beside the road:
Identity
Edge Definition Pattern
Usage
When using an edge to support, for example, reporting, the properties available to the
report, at the end of the navigation are, by default, those on the interface at the end of
the last relationship traversed plus properties on any implied interfaces. It is not possible,
by default, to reference properties on an interface that is implied by the interface at the
end of the "last" relationship traversed. Therefore, there is an option on the EdgeDef
(ValidInterfaceRefs) to identify a set of interfaces. That restricts the objects returned
to only those that have an instantiated interface. Then the available properties are only
from the "end" and "selected" interfaces.
Now let's define an edge (EdgeDef) that goes to a "particular port." The edge named
PipingPort1 defines a route between interfaces IPipingPortComposition and IPipingPort, via
the relationship named PipingPortComposition. In addition, there is a filter that says that
this particular edge is referring to the 1st piping port in the group (as opposed to the 3rd
or 4th). If that's too hard to understand, think of a collection of "anything", and now think
about retrieving the 1st member of the collection - get it?
An edge defines the path that goes from somewhere to elsewhere (an object to another
object, both of which have interfaces that are associated to each other by relationships)
via a "path definition" (PathDefn). The + and - indicate the navigation direction. Pop quiz:
If you want to show the end-prep that is necessary on control valve V-101, what should you
do?
Description of Pattern
Edges are used to:
- Traverse (go across) multiple relationships,
- Select only certain objects from the destination end
- Do multiple relationship traversal and selective discrimination.
Edges start at a specified interface (InterfaceDef) and can navigate across any
relationship (but at least 1) defined on that interface or any of its implied interfaces.
Therefore, an edge is available for navigation from any class that realizes the starting
interface.
Consequences
The edge tends to flatten a "normalized" model, and is very useful for making the schema
look more like what a user is used to seeing.
Implementation
Map out the route that you want to take from one object to another, through a relationship.
Then define the edge (EdgeDef). Finally, your query can use the defined edge to return a
set of data to the user that is centered around objects that the user understands.
Dorothy was not sure that the Scarecrow understood, because he always had that same
blank look on his face, so she went to her car and pulled out a map and a red pen and said,
"You can use a map to help you get from Chicago to L.A. Here's how:"
- Leave Chicago on Interstate 55, West
o Not Interstate 90 (towards Western suburbs)
o Not Interstate 94 (Northern destinations)
o Not Interstate 57 (Southern destinations)
- Travel to St. Louis
- Leave St. Louis on Interstate 44, West
o Not Interstate 64 (Eastern destinations)
o Not Interstate 55 (Southern destinations)
o Not Interstate 270 (a loop)
o Not Interstate 70 (Western destinations)
Dorothy summarized, "Do you see the starting point (Chicago), the nodes along the way (St.
Louis, Oklahoma City, Mojave) and the final destination (Los Angeles)? That's how an edge
works - it gathers up those things and lets you navigate objects from one to another, by any
route that you want." Of course, she still wasn't sure if the Scarecrow "got it", but she was
sure that she explained it right!
The Scarecrow, who has been a target many times before, is wondering where Toto is, right
about now. Noticing the blank look on the Scarecrow's face, Dorothy said: "Let's draw a
data model of this, and you'll see what's up." She was going to use the stick and scratch
some UML diagrams in the yellow dust, but decided to use the SmartPlant Schema Editor
instead. Here is what she drew:
"We can think of a 'city' as a collection of highways that go in and out of it. A city is lots
of things, but right now, it's convenient for us to think of its role as a transportation hub."
Finally, Dorothy said, "Let's create some sample data for this exercise. Here's what we'd
expect to publish:"
Finally, she saw the slight smile on the Scarecrow's face, and she knew that he finally
understood "edges" - but she realized that she still had to explain graphs and views, so she
knew that there were still a couple of more long afternoons with the Scarecrow. "Let's
take a break. Tomorrow I'll tell you the story of graphs and views and flying monkeys", she
said. The Scarecrow just smiled his enigmatic smile.
Similar Patterns
The mythical Land of Database would call edges "views", but the SmartPlant Schema already
uses that term for something else.
Anti-Patterns
N/A
Identity
Graph Definition Pattern
Purpose
Dorothy looked the Scarecrow right in the eye (due to a mean crow, he only has one) and
said: "Today we learn about graphs - I hope you're up to it." The Scarecrow just smiled and
thought how smart Dorothy was.
"You learned about graphs in grammar school, but by now, you forgot most of that, so let me
refresh your memory (Because his brain was made of straw, she was never sure what sunk
in). "Here is the technical definition:"
"A graph is thought of as a set of objects called vertices joined by links called
edges. Typically, a graph is depicted as a set of vertices and nodes joined by lines
(the edges). Depending on the application, some edges can be directed."
"Wait!" the Scarecrow blurted out, "That's just what I read a minute ago, but I can't
remember where."
"That's what I was afraid of," said Dorothy, "Let me show you what it means."
"Look back at the map (Figure 80) that we used to go from Chicago to L.A. Did you notice
the arrow? The head of the arrow points in the direction of travel, in other words, the
route is a directed graph. When I wrote out the instructions, I said start here, go to
somewhere, go another-where, and finally end somewhere - that's a directed graph." The
Scarecrow got it. Then he said, "But I can go back by the same route, what then?" Dorothy
said. "Right, but the route from L.A. to Chicago is directed, too - just in the opposite
direction!"
"Now look at the sample data that went with the trip (Figure 83). What do you think the
cities {Chicago, St. Louis, Oklahoma City, Mojave, Los Angeles} represent? They're called
nodes." Scarecrow was quivering in the breeze now, and the dawn of understanding was
awakening in the one coal-black eye. "That means that each highway that you picked is one
of those edges that you told me about yesterday, and the entire route is a directed graph!"
Look out, girl - he's got it!
"Remember, when you create a GraphDef, explicit EdgeDefs are not required unless you
need to apply criteria. One example is the Equipment to Nozzle relationship that we talked
about before. You have to turn the one-to-many relationship into many one-to-one
relationships using the position criteria. The Scarecrow was a little drowsy from the big
burrito lunch, and wondered aloud what relations she was talking about.
"Here now, straw head, no more Mexican food for you! Try to pay attention!"
The Scarecrow fluttered in the breeze - "OK! I get it! If I want to talk about nozzle 2 on a
process vessel, then the object that I'm talking about is the 2nd one in the equipment-
nozzle collection, so I need to make an edge that constrains the EquipmentNozzle
relationship somehow, and I see that I can make an EdgeDef where the RelCriteria value is
'2', then just that nozzle will be returned from the equipment-nozzle query." Needless to
say, Dorothy was relieved.
expansions and alternate expansions for class definitions. If the name of a class definition
is the same as the name of a graph definition, the graph definition is automatically used to
define the default expansion for the class definition. For example, when you expand an
object in the tree view, the graph definition with the same name as the class to which the
object belongs, defines the default expansion that you see.
You can also define alternate expansions for class definitions. For alternate expansions to
show up on the shortcut menu when you right-click an object in the SmartPlant Foundation
client, you must create a new method that uses the GetObjsbyGraphDefName client API
and references the appropriate graph definition. Default expansions created using graph
definitions show up in the method section of the shortcut menu that appears when you
right-click an object that exposes the starting interface defined in the graph definition.
Description of Pattern
Graph definitions (IDirectedGraphDef) are a set of definitions with structure. These can
be edges, as defined previously or dynamic edges, such as a relation expansion, identified by
its role name. Graphs provide a way of expanding from one interface down multiple
relationship paths (did you see that in Figure 88?).
Collaborations
Graphs, edges and views are used for mapping and for SmartPlant Foundation database
queries. They are navigation aids for traveling from one role to another -- like a Yellow
Brick Road from Munchkin Country to the Emerald City.
Consequences
Creating a graph is like taking a pencil and drawing a route on a map. You start somewhere,
travel in a certain direction, and end somewhere. Perhaps that’s why it's called a "directed
graph."
Implementation
A graph is defined by a GraphDef, and is created with the SmartPlant Schema Editor. A
graph can contain an edge, which makes sense if you remember that an edge connects
interfaces. Here is a real directed graph definition. Click your Red heels thrice and see if
you can figure it out:
+IFiredHeater/+IFiredHeater/,EDG_FiredHeaterFiredHeaterSecti
on1/FiredHeaterFiredHeaterSection1/+IFiredHeater,EDG_Heating
CoilBundle0/HeatingCoilBundle0/FiredHeaterFiredHeaterSection
1,EDG_FiredHeaterFiredHeaterSection2/FiredHeaterFiredHeaterS
ection2/+IFiredHeater,EDG_HeatingCoilBundle0/HeatingCoilBund
le0_0/FiredHeaterFiredHeaterSection2,EDG_FiredHeaterFiredHea
terSection3/FiredHeaterFiredHeaterSection3/+IFiredHeater,EDG
_HeatingCoilBundle0/HeatingCoilBundle0_1/FiredHeaterFiredHea
terSection3,EDG_FiredHeaterFiredHeaterSection4/FiredHeaterFi
redHeaterSection4/+IFiredHeater,EDG_HeatingCoilBundle0/Heati
ngCoilBundle0_2/FiredHeaterFiredHeaterSection4,EDG_FiredHeat
erFiredHeaterSection5/FiredHeaterFiredHeaterSection5/+IFired
Heater,EDG_HeatingCoilBundle0/HeatingCoilBundle0_3/FiredHeat
erFiredHeaterSection5,EDG_FiredHeaterSootBlowers1/FiredHeate
rSootBlowers1/+IFiredHeater
Similar Patterns
N/A
Anti-Patterns
N/A
, normal users need a more, a-hem, 'user-oriented' view of the data for it to
be meaningful."
"I'm not sure I understand what you just said," said the Scarecrow. "How is it possible that
there is more data than there needs to be?"
"Let me explain, my old, stuffy friend", Dorothy replied, but she didn't understand why the
Scarecrow didn't understand:
"As you build an edge (EdgeDef) or a graph (GraphDef), you make the properties that each
interface exposes, "visible" to the user. So what seems to be a simple graph can wind up
showing hundreds of properties, and the poor end-user won't have a chance of
understanding what you really meant. It's not 'wrong', but it's just not 'right', either -- if
you look at the graph that is defined in Figure 89, what you want the user to see is just
'what's relevant', not 'what's possible' - burdening the user with dozens or hundreds of
properties that s/he doesn't care about is never OK." The Scarecrow just shrugged.
Identity
View Definition Pattern
Purpose
Views are the SmartPlant equivalent of relational database views, in other words, a
combination of joins and projects (pronounced prO-jécts with a long O, and accent on the
2nd syllable). Joins are used to retrieve the desired objects, and projects are used to
determine which properties (columns) to include, and what to call them. The Scarecrow
wasn't too sure of those words, but Dorothy assured him that there wasn't going to be a
quiz Friday night in the Emerald City Pub.
Usage
Views are created to "throttle down" an edge or a graph to show just what is relevant to a
user. Because you can have as many views as you want, it's easy to see that having many
precisely targeted views will give the user a better chance to understand his data.
Remember that it's easy to confuse, and hard to lose that reputation. Pretty soon,
everyone will be saying, "It's too complicated", and they'll be right. Give your users a
special treat; always give them a view when the results can be made more precise.
The only thing that's unusual is the class factory, and that doesn't mean much outside of
the schema component.
Description of Pattern
View definitions (ViewDef) are similar to relational database views, that is, they combine
joins and projects to retrieve some set of objects. Even a simple edge definition can
expose many irrelevant properties, and it just confuses the end-user. Speaking of "too
much of a good thing", create a simple edge for equipment (IEquipmentOcc) and its nozzles
(INozzleOcc) -- there are 406 properties on those two interfaces. Are you sure that you
want a user to see all of them? Are you focused on what a Nozzle report would look like for
all the equipment in some unit of the plant -- let's say just 8 nozzles per, we're talking
about one bodacious report! Therefore, define a view so that you can just expose the
properties that are relevant at that time.
In SmartPlant Foundation, views are used to define what users see in the Properties window
when they select an object in the client. When you create ad hoc reports in the SmartPlant
Foundation client, you can also select the view that you want to use as the basis for the
report, as well as the properties from that view that you want to include in the report.
Furthermore, you can use views to create alternate views for classes.
Consequences
Good views make queries and ad hoc reports easier to understand by end-users.
Implementation
Views can only be made using the SmartPlant Schema Editor.
Similar Patterns
A database-based person would recognize the idea of views, joins, and projects presented
here.
Anti-Patterns
N/A
Identity
Shared Objects, Expansion and SameAs Pattern
Purpose
Papa bear uses Aspen Basic Engineering to do simulations of the process plant, and Aspen
PFD software to get a look at piping flow diagrams. The output of his day consisted of
theoretical units that were mostly thought experiments. Some of them are called unit
operations, because they defined how a unit is supposed to perform, for example, some unit-
op is needed here so that the fluid pressure gets increased by 5%. Other things probably
came from earlier designs that were similar to this one. After you've built a couple of
yogurt plants, the next one should be pretty easy because you know a lot about what's
required.
Brother bear uses Smart Materials (previously called MARIAN) to procure the pipes, valves,
pumps and such, from various manufacturers. When the stuff arrives, he checks the serial
numbers and keeps a pretty good check-list of what's what. Then he's got a pretty busy
day sending stuff to the right units, where it is being assembled according to a schedule -
he can almost taste the yogurt now - mmm'mmm - right tasty!
Got the picture? A happy team of collaborative engineers, who share data, and schedules
and ideas, and previous knowledge about stuff -- a fairy tale, you say? Nope - they're using
SmartPlant Enterprise-enabled tools to do all that stuff (will they live happily-ever-after?
Dunno)
Does any of this have a familiar ring? It ought to. The only problem is that there are a few
ideas that need to be worked out before all this can happen:
- How do you know that Papa bear's requirement for increasing pressure
o is fulfilled by a pump that Mama bear will order
and that's the same pump as Brother bear will install and test?
• and keep track of forever
o and use the same ideas in the next yogurt plant
and so on
- What happens if Mama bear deletes the pump from her P&ID?
o How does she tell Papa and Brother bear?
And what do they do?
• and so on
- What happens if Mama bear needs to order 2 pumps to fulfill the "increase
pressure" thing that Papa wants to do? Mama bear is conservative, and wants to
have a safety factor built-in. How does she let everyone know what's up?
- When a pump is delivered from the vendor, how does Brother bear know which
one it is? Where is it on that darned old P&ID? The P&ID changed since the
pump was ordered? Mama bear deleted it? Oooops!
- What if Mama bear goes on vacation? Who will print the equipment data sheets
so that Brother bear can order stuff?
- and so on
One way to keep track of "things that are shared by different folks" is to define them (in
the schema) as "shared", and track them that way. The facility for increasing pressure in a
pipe line that Papa bear wants, becomes pump P-101 on Mama bear's P&ID. The two pumps
(his/hers/theirs) are the same "shared pump." When Brother bear gets the Equipment
Data Sheet from Mama bear, he orders it from the vendor, and it arrives as an actual pump,
with a serial number - but it is the same "shared pump." How did it get to be that way?
Through the concepts of "shared objects" and the SameAs relation.
Usage
In the real world of collaborative engineering, there is a need to identify and share objects
that are created by different tools, at different times. The schema "enables" the sharing
of objects between the tools. After an object is published by someone, other tools can
"correlate" that object to their own object, and once that is done, all the tools that have
correlated objects can access and change all the data (that they are allowed to do by rule).
Say what? can all work on their different ideas about what "they" need,
but then come together later on, inside the SmartPlant Foundation database, and "share"
their objects with each other. His pump/her pump/their pump - that's pretty useful in a
collaborative engineering environment, for example, because they don't have to wait for
each other to finish something before they can move on.
Description of Pattern
SmartPlant Enterprise doesn't just have a correlation step (which establishes a SameAs
between pumps), the publishing software can also publish a "material expansion"
relationship, for example, one pump to two (for a lot of good reasons, this happens pretty
regularly during the design stage).
Look at the 2 pumps in Figure 95. They're there because of a design decision. On the PFD,
there was only 1. Probably, the PFD pump will be correlated to (via SameAs) P2A, and there
will be a material expansion relationship (MatlExpansion) published between P2A and P2B.
At least that's what we're hoping for.
Collaborations
This pattern allows tools to share objects, and to expand objects - that's right at the heart
of the modern collaborative engineering design processes. Different engineers, using
different tools can define specifications for something, and then fulfill the role with
something, and later, expand the fulfillment - life is good.
Consequences
SmartPlant Enterprise tools can publish and retrieve objects and share and expand them
with this pattern. Shared objects allows tools to:
- Declare that my "this" is the same as your "that"
- Support the idea that one of your "things" is the same as more than one of my
"things"
Implementation
To make shared objects and material expansion work, you need to do this:
- Two or more tools publish objects
o The ClassDef for the object must be a shared object
With the same shared object definition (SharedObjDef)
Similar Patterns
N/A
Anti-Patterns
You might want to be careful about the SameAs relation and material expansion
relationship, if they are both used in the model (which is pretty likely). There is a
possibility of an obscure side effect, that is, the properties of pump P2B may not be the
same as the properties of pump P2A, which is the pump that is correlated to the pump on
the PFD. In this case, any properties that are different on pump P2B may not show up in a
standard query, because the query may not know about the material expansion (just a
caution).
POSC/Caesar Pattern
A key part of the underlying "Architectural Model" of the schema has its roots in
POSC/Caesar. Please refer to Chapter 23 in "A Gentle Introduction to the SmartPlant
Schema" for a good introduction to this topic.
Identity
POSC/Caesar Pattern
Purpose
The POSC/Caesar data model can serve as an overall model for a process plant, or any large
facility, from the conceptual design phase through construction, handover, operation and
decommissioning and dismantlement.
The POSC/Caesar model was one of the first complete models to consider the entire
lifetime of a facility. There are two main concepts that are proffered by POSC/Caesar:
- The early-stage concept of a "Facility model" = conceptual things, for example,
the output of a simulation. Or, the Company President saying "we're going to
need a new polymer production facility" (he doesn't know how many pumps will be
required).
- The late-stage design concept of a "Material model" = purchased, fabricated, or
constructed things, for example, a pump that is ordered from a catalog and
installed in a plant.
Usage
The schema has some of the POSC/Caesar ideas "built-in", for example:
- Simulated facility = for example, the output of Aspen Zyqad
- Typical material = catalog data
- Planned material = material that we plan to purchase
- Actual material = an item with a serial number
- and so on
Material Model
The Material model is used in the procurement and fabrication process that will fulfill the
design requirements that were established in the Facility model.
Description of Pattern
Here's an easy way to think about the pattern: in the design process, "Facilities evolve into
Material."
Facility Model
The POSC/Caesar workflow implies that Facilities evolve from simulations, predictions,
requirements into planned, and finally actual Facilities.
The schema doesn't support all of these steps, but can easily be enhanced, if that is
required.
The flow chart just above shows how things are specified in a "catalog", for the purpose of
fulfilling a (required or planned) requirement, then the items get a "tag", get purchased, and
finally, an item with a serial number is installed.
It isn't the Planned Material of this plant feeding the Required Material of this plant, so
don't get confused - the feedback-looking relationship is really a feed-forward relationship
(from this instance of a plant to the next planned facility).
Occurrences are
Planned Material
Now, look at Figure 100, below. What the Father of our country probably meant was: "If
you see a pump on a P&ID, and it has a "tag number", then the designer has it in his mind
that someone is going to procure a pump and associate it with that tag number."
In the schema, we mean that a "tagged pump" is "an occurrence of a pump", because we
expect an occurrence of it to appear somewhere, for example, in the plant, when
construction is complete. The pump occurrence is in the Planned Material model, because
someone plans to purchase the pump. George says, "Repeat after me: 'Pump P-142 is an
occurrence of a pump'."
The pump that is purchased (to fulfill the requirement of a "tagged pump" on a P&ID) is
called "Actual material", and has a serial number, maintenance history, and so on, which are
attributes of that "actual pump", not the "tagged pump."
Relationship Definitions
In order to accommodate the cycle of Typical material -> Required material -> Planned
material -> Actual material, the schema has some relationships that help out:
- From Typical material to Planned material = PlannedMatlActualization
- From Typical material to Required material = Typical_Required
- From Required material to Planned material = PlannedProcurement
- From Planned material to Actual material = Procurement
- From Planned material to Planned material = MatlExpansion
And the relationships from the Actual material model of this design cycle feed forward to
the design cycle of the next facility like this:
- Required material to Predicted facility (not implemented)
- Planned material to Planned facility (not implemented)
- Actual material to Planned facility (not implemented)
- and so on
Collaborations
SmartPlant-enabled tools work in a collaborative engineering environment to evolve a design
from "Facility" to "Material", and then on to the next "Facility." The patterns that are
learned in one design can be applied to the next, similar design - that saves time and money!
The full-lifecycle approach of the POSC/Caesar Pattern maximizes the probability that all
phases, from conceptual process design through facility operation are exploited, as much as
possible.
Consequences
Using the POSC/Caesar Pattern leads to clear thinking about the holistic engineering design
cycle:
- Conceptual Process Design
- Conceptual Engineering Design
- Detailed Process Design
- Detailed Engineering Design
- Procurement
Even if all of these phases aren't implemented right away, the underlying architecture and
schema artifacts are present and can be enabled later on. Don't you agree that the
consequences of thinking about a "holistic design cycle" can be mighty beneficial?
Implementation
Upstream, in the Conceptual Design phase, we're thinking about abstract facilities, so
classes there will probably realize "Facility" interfaces. Farther downstream, in the
detailed engineering phase, classes will realize the "Material" interfaces. Figure 103 shows
how the requirement for a pump on a P&ID (a "facility") is fulfilled by a pump on an
equipment data sheet ("material") via the PlannedFacility_PlannedMaterial relationship.
Figure 103 Two Pumps that are Polymorphic with Respect to IMaterialItem
Similar Patterns
The POSC/Caesar model has been absorbed into some of the more recent European
standards.
Anti-Patterns
N/A
Identity
Typical Material vs. Planned Material Pattern
Purpose
In the collaborative engineering design life-cycle, the engineer might start with a
requirement, and fill it with an item from a catalog, or start from a catalog item, and then
use it in the design. We discussed the idea of a "facility" evolving to "material" in the last
section (§5.1). The schema has a model of "typical" things and "planned" things built right
in. If you want pump P-101, on a P&ID to be a specific pump, for example, from a certain
pump catalog, then "have we got a deal for you."
Usage
Do you remember that planned material is, for example, "a plan to purchase something" and
that maybe it can be from a catalog of "typical" stuff? The schema has a way to represent
planned material (IPlannedMatl) and a way to represent typical material (ITypicalMatl), so
let's see how they are used.
Typical Material
Think about some valves. You're probably visualizing:
- Valve
o Linear Valves
Globe valve
• Globe valve, reduced port
• Globe valve, rotary
o Hose valve
o 3-way valve
o Control valve
o and so on
In general, there are some "valve-type-ness “ ideas that come to mind about all valves,
meaning: "within the class 'valve', what 'type of' valve is it"? Earlier, we talked about
classification of objects, and how it deals with breaking down big classifications into smaller
and smaller groups of similar things.
The class "Animals" contains the subclasses {Mammals; Reptiles}, each of which contains
closely-related subclasses, and so on. Now, do you understand what a "class type hierarchy"
is?
Common properties about a class are grouped together and yield up a "typical" role to the
universe (via the ITypicalMatl interface), for example, a characteristic of the class of
mammals (Mammalia) is that they typically have hair.
Typical is Optional
There really doesn't need to be a "typical" role for everything in your life, but it may save
you some design time, when you consider the number of valves that are in a process plant, or
animals in the animal kingdom.
Think of this: In the document that SmartPlant P&ID will publish, almost certainly, there's
going to be "an occurrence of a valve", that is, a "tagged" item. In addition there may be
valves that are called typical valves, which describe characteristics of valves in general, but
do not show up on, for example, a P&ID. Other tools may publish valves in a catalog, and
maybe valves that have a serial number (actual valves).
That looks pretty good, but the addition of the IManufacturer interface and the new
relationship Mfr_Models could cause tools that publish data some problems, because they
would have to keep track of those new objects in their data space. Therefore, let's look at
that model, but denormalize IManufacturer and IModel into one interface, shown in Figure
105.
It's OK to get rid of those extra objects, and it doesn't create any ambiguities in the
model.
Now, let's say that we've already got the interface IManufacturedItem that already has
those properties, plus a couple more, and then let's hook that into the Typical material
model, as in Figure 106.
Finally, Figure 107, below, shows the Typical material and Planned material models together:
Planned material items are, for example, items that are tagged, and are later purchased. Do
you get it?
Look at the PFD in Figure 108. Maybe the "Feed Pump" is a 200 gpm pump:
- You (in collaboration with a specialist) look at the "type hierarchy" of pumps and
decide that you need a vertical, centrifugal pump to fulfill that role
- You look for one of those in a manufacturer's catalog and find it!
- Now you can actualize it (plan to purchase it). I don't know what your process is
for doing that, because everyone invents their own workflow, but if your
procurement system is integrated with SmartPlant Foundation, life will be a lot
easier when you go to procure the item.
- Did the item need to come from a catalog? Nope.
- Is it helpful to have a pump catalog if you want to order a pump? Usually.
- Note: This idea works both ways across the PlannedMatlActualization
relationship, that is, you can find planned material by looking it up in a catalog or
you can start from a known catalog item and plan to purchase it.
Now that you understand the basic concepts of "typical" and "planned" material, let's see
how it is applied to a couple of good examples, for example, equipment, cable trays, cables,
and that kind of stuff. Several examples will bring home the points better.
Here's a nice, rich, juicy diagram, and you should take the time to understand the subtle
flavors:
- Equipment and components might appear in some catalogs (Mfr_Model_Catalog)
- The "typical material" role may expose "typeness", for example, IEquipment
exposes properties for the equipment type hierarchy
- Occurrences of equipment (IEquipmentOcc) and components
(IEquipmentComponentOcc) are "planned" material, and are commonly called
"tagged" items
o Each of the tagged items might have some of the characteristics of the
typical material, because they share interfaces (via the Implies
relationship between IEquipmentOcc and IEquipment). For example,
"typeness" might be shared between an object that exposes both
IEquipment and IEquipmentOcc.
o However, the properties on the tagged item might be different from the
properties on an item that is typical material, and if so, then two objects
are published, and are related to each other by the
PlannedMatlActualization relationship, or a child of it.
o Occurrences (planned material) are usually part of a Plant Breakdown
Structure, for example, Plant / Functional Area / Functional Unit, or
similar.
Does the cable tray model look familiar? It's supposed to because this a book about
patterns!
By now, you should be able to see the pattern that will be replicated for all the other
schema elements.
Now, here is the piece de resistance, that is, a pump catalog, with a selected pump (typical
material), and that pump is related to a pump on an equipment data sheet (therefore, we
plan to purchase it). SO - the typical material pump (a very nice Gould pump) is actualized
by a planned material pump, after all.
Planned material is a plan to purchase (or fabricate) something. If you look at a PFD and see
that you need a pump, you're probably going to need to purchase it. Where to get it? What
should it look like? What characteristics are important? Really, only a domain expert
knows.
The expert will probably fill out an equipment data sheet, which defines some of the
important characteristics that must be fulfilled. Probably, someone will reach for a couple
of pump catalogs, grab the data sheet, and try for the best possible match between
requirements and what is listed in the pump catalog. When the best match is found, the
item that is identified on the equipment data sheet, and the item that is picked from the
catalog get related (PlannedMatlActualization), so that later on, when the pump is ordered,
and delivered, it can be tied back to the original requirement.
Collaborations
The typical material to planned material workflow is what the dear customer knows all about
(we sure don't). Somehow, our customers have figured out the optimal procedures for
looking at a tagged item on a P&ID and figuring out how to get it to the worksite. Does the
SmartPlant schema help? Yes, because reports can be generated from SmartPlant
Foundation that show the status of the item, from the time that it first became a
requirement up until it is installed and tested, maintained, and decommissioned.
Consequences
Changing the model makes it a lot clearer, and makes it correct. Summary of changes:
1. The IPart interface has been eliminated, use ITypicalMatl instead
2. The IPartOcc interface is gone, replaced by IPlannedMatl
3. The Part_PartOcc relationship is gone, replaced by PlannedMatlActualization
a. If your tool needs a specialization of this relationship, contact support
4. A new interface ICatalog has been added, it exposes the catalog properties. We
could add catalog ID, catalog year, version, revision, or anything like that.
5. A new interface IMfrModel has been added; it exposes manufacturer name and
manufacturer model number. Because it implies ITypicalMatl, the Name field of the
underlying object will contain the catalog part number
6. A new relationship MfrModel_Catalog is added so that catalogs can reference parts
in either a manufacturer catalog or a distributor catalog (where a single catalog lists
the contents of many catalogs).
Implementation
Typical and planned material roles are easy to implement. Looking back at the Equipment
and Equipment Components UML diagram in Figure 110, we see that underlying pattern of
polymorphism, that is, a pump that is viewed as typical material (IEquipment implies
ITypicalMatl) or planned material (IEquipmentOcc implies IPlannedMatl).
Similar Patterns
N/A
Collection Pattern
A collection is a group of things that is considered as a whole or a group of items that has
one or more common properties. By "common properties", we mean "in whatever way is most
convenient for the user."
Identity
Collection Pattern
Purpose
A collection is very common in real life. Sometimes it is obvious, for example, "a herd of
buffalo" is a collection, but sometimes it is less obvious. For example, "the work processes
that it takes to build a process plant" is a collection, too.
Listen up: if you're still not convinced that the mind of a Data Modeler (DM) is strange, just
try to follow along:
1. Looking at the local supermarket parking lot, you see a bunch of cars
a. DM thinks: "Therefore, the parking lot is a collection of cars."
2. A supermarket parking lot may be many things, but as data modelers, when we see
the "is a" phrase, we think, "implies."
a. DM thinks: "A something that is also something else."
i. DM thinks: "Role 'A' is extended by role 'B'."
1. DM thinks: "We extend the role of ‘parking lot’ to include the
role of being a collection of cars,"
thus:
10,000 cars in it. "In fact," says, "Next time you're at the
supermarket, check it out and see if that's true about the 10,000 cars -- especially
if you're in a rush to just pick up a quart of milk!"
4. Pay particular attention to the "minimum" cardinality on the Car Collection role - it is
zero, which has some special meaning:
a. A car can exist without being in a collection, because a car can belong to
zero or one collections
b. From which we, as great and powerful wizards of data modeling think, "That
means that if the parking lot goes away, the cars will still be there!" Hoo-
boy - data modeling anyone?
5. Isn't it interesting that the maximum cardinality on "Car Collection" is 1? It means
that a car can only be in a maximum of 1 parking lot at a time (a data modeling joke:
active moms wish that this could be *). Hoo-boy - surf's up - data modeling anyone?
Let's go one more round with the idea of "minimum" cardinality of zero. Think of a
collection of peas in a peapod. If the peapod is disposed of (cardinality goes to zero), do
the peas still exist? Compare and contrast this behavior with the "Composition Pattern",
below.
Usage
The Collection Pattern is widely used, and easy to understand. Examples include wires in a
cable, components inside your computer, the junk in your kitchen drawer. Something acts
like a collector, and there are some items that participate in that collection.
One nice feature of collections that are defined in the schema is that they can be
"ordered." When you put a collection of colored lights into a StopLightController object,
you can put them on in a certain order (probably Red, Yellow, Green), which the retrieving
application will know, when it retrieves your document.
Description of Pattern
Items that are somehow related are grouped into collections. The collector has a
cardinality of 0..1 and the collection has a cardinality of 0..*.
Collaborations
The retriever of a collection iterates through the set of objects in the collection, and one-
by-one consumes them.
Consequences
The retriever of a collection expects zero or more items to be returned from the collection.
They may or may not be in sequence, based on whether the RelDef declared the collection
to be ordered.
Implementation
Best practice is to imply a collector and relate it to a collection. Look back at Figure 117.
What we're trying to communicate is that a "parking lot" is extending its functionality by
implying that it is a "collection of cars", in addition to whatever else it is.
Similar Patterns
Composition Pattern
Anti-Patterns
Almost any relationship can be thought of as a collection, but that's not quite right.
Relationships where both cardinalities are "0..1" or the minimum cardinality is greater than
zero are probably not called collections.
Composition Pattern
A collection is a group of things that is considered as a whole, or a group of items that has
one or more common properties. A composition is a special type of collection that has a
strong "delete semantic", which means that "if the collector is destroyed, the collection is
destroyed, too."
Identity
Composition Pattern
Purpose
A composition is a type of collection that frequently occurs during the "design phase" of a
new facility. For example, let's say that a designer draws a vessel on a P&ID, and hooks up
some pipe lines to some of the nozzles on the vessel. What happens to the nozzles if the
designer erases the image of the vessel? If the nozzles are in a "composition" relationship,
then they all go away! (Lack of parent forces lack of children.)
Description of Pattern
Items that are closely related are grouped into compositions. The collector has a
cardinality of 1 and the collection has a cardinality of 0..*. Because of the cardinality of 1,
no children can exist if the parent is deleted.
Collaborations
The retriever of a composition iterates through the set of objects in the collection, and
one-by-one consumes them. The relevant difference between a collection and a composition
is that a semantic must exist that takes care of deleting children when the parent goes
away.
Consequences
Compositions are used to specify collections whose existence depends on a parent.
Similar Patterns
Collection
Anti-Patterns
Please be careful about specifying a Composition instead of a Collection. Be real sure that
the strong delete semantic is required -- do your analysis homework!
Connectivity Pattern
The "Connectivity Pattern" shows how an object called a "connector" exposes logical points
called "connections", to which other objects may connect.
Identity
Connectivity Pattern
Purpose
Define how "connectors" and "connections" behave so that networks of pipes, or electrical
wires, or whatever, can be put into the model.
Usage
The Connectivity Pattern is applicable to most kinds of connections that are in a normal
network of physical objects. Examples include piping systems, electrical wiring, connecting
equipment to a pipe run, and so on.
says that Figure 118 can be read as "Many connectors can be related to many
connections." So we need to understand the role of "connector" and "connection", and then
look at how the relationship between them is defined.
Description of Pattern
Forming connections between objects is very common in the engineering world. For example,
pipes are connected together, electrical wires are connected together, HVAC ducts are
connected together, in-line equipment connects to nozzles, which connect to a pipe, and so
on. The Connectivity Pattern explains how objects can connect with other objects via a
relationship named "Connections."
Connector
The word "connect" means "something that joins or fastens together." Therefore, a
"connector" is defined as "an instrumentality that connects", for example:
A water pipe joins a water storage tank to a place where the water is available for
sprinkling on the garden. The water pipe is a connector.
An electrical wire joins a fuse box to a toaster. The electrical wire is a connector.
A steel beam joins two floors of a building. The steel beam is a connector.
A series of pipes are connected from point 'A' to point 'B', and are called pipe run
'P'. Each pipe is a connector.
What does that mean? Check it out: in a pipe, fluid may flow from end 1 to end 2, or from
end 2 to end 1, or either way, or maybe we don't know which way it flows (yet). We're
guessing that the pipe might be 10 feet long. We don't have a clue what the "all zero
length" thing is, so we'll ignore it. That wasn't so bad!
Connection
The logical, not physical, point where two things join is called the "connection point", or
simply the "connection." For example, the logical place where one pipe connects to another,
or one wire connects to another wire, and so on, is called a "connection." The "physical
connection" might be large or small or simple or complex, but it is represented as a "logical
point" in the Connectivity Pattern.
Collaborations
Let's see how the SmartPlant Enterprise tools use the Connectivity Pattern to publish and
retrieve data:
1. At a high-level, for piping systems, the Connectivity Pattern can be used to hook one
pipe to another, and then publish those pipes, and the fact that they're hooked
together.
2. The Connectivity Pattern can be used to hook pipes to equipment nozzles.
3. It can be used to hook an instrument into a pipeline.
think about that problem. Q: "Hey, how can we hook up to this pipe?" says,
"At either end, or anywhere else!"
Implementation
Now, let's evolve the SmartPlant schema model in steps - like frames in a movie, which
started at Figure 118:
Figure 121 shows that a piping connector is a type of connector because InterfaceDef
IPipingConnector Implies InterfaceDef IConnector. You could have read that as one
subtype of connector is a piping connector - OK.
Figure 122 Three Relationships between Piping Connectors and Piping Connections
Figure 123 shows a couple of classes that realize that they're piping connectors, and by the
transitive property of the Implies relation, namely, IPipingConnector Implies IConnector,
they realize that they are also connectors.
In Figure 125, you see that the point of showing a “SmartPlant P&ID" piping connector and a
"Smart 3D" pipe connector (in Figure 123) is that they both are "shared objects", meaning
that those two programs can update each other's data about connectors (as the design
evolves).
By now you probably understand that a pipe is a connector, and it has logical connection
points to be used for attaching something to it. But did you think of an electrical cable as a
connector? Sure, one end goes to a circuit-breaker and the other end goes to a wall
receptacle. OK. What about a wire, a conduit, a signal in a control system? OK. How about
any object? The simple solution is to see if the class realizes the IConnector interface. If
it does, then it is.
Participants
Figure 126, below, is an abbreviated diagram that shows classes that typically use the
"Connection Pattern."
Similar Patterns
Which SmartPlant Enterprise tools use the Connectivity Pattern? Most of them, including:
SmartPlant Electrical
Smart 3D
SmartPlant P&ID
Aspen Basic Engineering
and so on
Anti-Patterns
N/A
Wouldn't you agree that a "bully" is a good example of an "anti-pattern"? What about
preparation for, and response to, hurricanes Katrina and Rita in 2005? Were some of those
ideas probably "anti-patterns"? Do you agree that the loss of Space Shuttle Columbia, due
to launch during temperature conditions that were too cold for the O-rings to function
properly was an "anti-pattern"?
For each pattern, we tried to present (zero or more) relevant anti-patterns. "How do you
refactor for success?" should always be asked when a failure occurs.
Schema Ambiguity
If you retrieve a document that has a "Motor" and an "Electric Motor", what are you
supposed to do? I don't know, either. See, it was easy for one tool to publish a motor and
it was easy for another tool to publish an electric motor, but pity the poor retriever.
Unfortunately, not all schema elements are unambiguous. In the name of expedience,
sometimes schema is "absorbed" from outside sources, without taking the time to do proper
analysis, and normalization. That causes problems downstream, but everyone reading this
book knows about the word "expedience."
Refactor: The best advice is to restrict using "string" to things that are "descriptions", and
to enumerate almost any other string-like properties.
Refactor: If you're creating a relationship definition, and either role already has a
relationship with another role, ask yourself if the new relationship could properly be a child
of the existing relationship.
Here's an example: the properties name, address, city, state, ZIP, phone. Where do you
put them? Should you have an interface "IContactInformation" that has those properties?
Should you put them right on the "IManufacturer" interface instead? would
put them on "IContactInformation", because those properties can be tightly-bound and are
closely related to that role. However, over a beer and pizza, we can debate it further - HA!
My Anti-Patterns
Add your own anti-patterns here:
"...how to, for example, tie shoes..."
Applying UML and patterns : An introduction to object-oriented analysis and design / Craig
Larman
cm.
Includes index
ISBN 0-13-748880-7
Object-oriented methods (Computer science)
UML (Computer science)
System analysis
System design
1997
A System of patterns /
Frank Buschmann ... [et al.].
Includes bibliography and index
ISBN 0-471-95869-7
1996
HINT: You can print out this image of your favorite new Super Modeler "Schema Man!" and
his friends and make a mighty nice t-shirt transfer!
Schema Man!
A Gentle Introduction to SmartPlant Schema Patterns, Process, & Practice 154
Appendix B Images
Bicycle picture
http://images.google.com/imgres?imgurl=http://www.hasslefreeclipart.com/clipart_transpo
rtation/bicycle.gif&imgrefurl=http://www.hasslefreeclipart.com/clipart_transportation/pag
e1.html&h=213&w=245&sz=13&tbnid=NPcyyqSeFzO2kM:&tbnh=91&tbnw=105&prev=/images
%3Fq%3Dbicycle&start=1&sa=X&oi=images&ct=image&cd=1
Nubian Wedding
http://upload.wikimedia.org/wikipedia/en/thumb/8/88/Egypt-Nubian_wedding.jpg/180px-
Egypt-Nubian_wedding.jpg
Compressor Spool
http://www.westmetalworks.com/images/dynamic/009.jpg
Pump Simulation
http://www.netl.doe.gov/publications/proceedings/01/vision21/v213-1.pdf
Raven
http://images.google.com/images?q=tbn:nvQduJv1X5JEKM:www.jimhayes.com/photo/raven.j
pg
FDR
http://www.whitehouse.gov/kids/presidents/images/100-FDR1.jpg
Edge, EdgeDef
Single or multiple relationship definitions with
direction. In the schema, an edge definition is
used to traverse from a starting object to
related objects
SmartPlant schema An XML file that describes the structure of the XML files
generated by SmartPlant Enterprise authoring tools in much the
same way as a data dictionary describes the structure of a
database. As tools publish documents in XML format, those
documents must adhere to the format defined by the schema to
ensure that the XML data can be loaded into SmartPlant Foundation
and retrieved into the other authoring tools
Facility
(POSC) A business function or service provided by
equipment items and materials.
Graph, GraphDef
A connected network of edge definitions with
structure. Each graph definition in the SmartPlant
schema starts at an interface definition and
traverses through one or more relationship
definitions to another interface definition at the
other end. Graph definitions are sometimes
referred to as directed graph definitions
Hierarchy
A classified structure with superiors, or roots,
and subordinates, or dependents, used for
grouping data
Project
A logical unit of data that is a subset of the
items that make up a plant. A project is used for
making controlled, incremental changes to the
data in a plant. There can be multiple projects
for a plant at any given time
Publish To share a document and its data with other authoring tools by
exporting an XML file containing the document data and
relationships to SmartPlant Foundation. When a document is
published, the software places the XML file in the appropriate
SmartPlant Foundation vault and loads the data from the XML file
into the SmartPlant Foundation database. After the document is
published, users can retrieve the data from the XML file located in
the SmartPlant Foundation vault into other authoring tools.
Retrieve To import document data from an XML file that was published by
another authoring tool for the purpose of maintaining consistency of
data across tools. When you retrieve a document, most authoring
tools analyze the impact of the newly retrieved data on the existing
database and then place tasks on the authoring tool's To Do List
that allow you to create, delete, or modify items at the appropriate
time in the design process.
Schema A diagrammatic representation, an outline, or a model.
ScopedBy
The relationship between “property definitions”
and “property types” in the SmartPlant schema.
The scoped by relationship specifies the property
type that defines acceptable values, or scopes, a
particular property definition. Every property
definition in the SmartPlant schema is scoped by
one and only one property type. All properties of
that property definition must be of that property
type.
Schema component
A suite of ActiveX components that provide
functionality surrounding the creation, parsing,
validation, and comparison of the SmartPlant
schema and data. The tool adapters interact with
the Schema Component to read the SmartPlant
schema, to create data for publish, and to
retrieve data
Semantic
The dictionary says "the study of meaning", but
we mean it to be more like "the rules that are
invoked when an action takes place"
SI unit
International System of Units, sometimes
referred to as the metric system. When values
for units of measure are published, they are
converted to SI units and stored, regardless of
the units of measure selected when the user
defined the value in the authoring tool.
SmartPlant Enterprise
A suite of integrated engineering applications
delivered together.
Taxonomy Wikipedia says "(from Greek verb tassein = "to classify" and nomos
= law, science) may refer to the science of classifying living things
a system of classification in some other field.
Tool schema A set of schema objects that describe the data in the
authoring tool databases before it is transformed into the
format prescribed by the SmartPlant schema. The tool
schema also specifies the mapping between objects in the
tool database and the SmartPlant schema.
Typical material (POSC) Representative materials characterized by standard
identifiers and recommended, normal, or statistically
representative properties and compositions.
Work breakdown structure The composition of the plant based on the construction work to be
(WBS) completed. The plant usually occupies the top level of the hierarchy;
it is typically followed by projects, contracts, and documents.
XML Extensible Markup Language; the format for all documents
published to SmartPlant Enterprise or retrieved from SmartPlant
Enterprise. These XML files must conform to the structure defined
by the SmartPlant schema.