3. Introduction to Modeling 1. Plan for Today's Class 2 ... - Courses
3. Introduction to Modeling 1. Plan for Today's Class 2 ... - Courses
3. Introduction to Modeling 1. Plan for Today's Class 2 ... - Courses
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 1 of 12<br />
<strong>1.</strong> <strong>Plan</strong> <strong>for</strong> <strong>Today's</strong> <strong>Class</strong><br />
• Models and modeling<br />
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Bob Glushko (glushko@sims.berkeley.edu)<br />
Document Engineering (IS 243) - 26 January 2005<br />
◦ The classical modeling approach<br />
◦ <strong>Modeling</strong> <strong>for</strong> analysis<br />
◦ <strong>Modeling</strong> <strong>for</strong> design<br />
◦ Implementing models<br />
• <strong>Modeling</strong> Methodology: Processes, Meta-models, Artifacts, Notations, Tools<br />
2. What is a Model?<br />
• Models are simplified descriptions of a subject that abstract from its complexity <strong>to</strong> emphasize<br />
some features or characteristics while intentionally de-emphasizing others<br />
• Models enable us <strong>to</strong> describe and communicate systems regardless of the specific domain or<br />
discipline that they represent<br />
• A model can represent a human activity, a natural system, or a designed system<br />
• We can model structures – objects, their characteristics, their static relationships with each other<br />
like hierarchy, and reference<br />
• We can model functions, processes, behaviors – dynamic activities that create and affect<br />
structures<br />
<strong>3.</strong> An Everyday Model: The Recipe<br />
• A recipe describes both objects and structures (ingredients) and the processes (instructions) <strong>for</strong><br />
creating a food dish<br />
• The model is not the dish itself – you don't eat the recipe<br />
• You can communicate a recipe <strong>to</strong> someone else who can then create the same dish<br />
• You can use the recipe as a guide <strong>for</strong> experimentation with the objects or the processes in the<br />
recipe <strong>to</strong> create alternative dishes<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 2 of 12<br />
A set of recipes may contain common or re-usable objects (e.g. flaky pastry) or processes (stir-fry)<br />
4. Methodologies – Disciplines <strong>for</strong> <strong>Modeling</strong> [1]<br />
• When we create a model we follow – implicitly or explicitly – some steps or techniques <strong>for</strong><br />
analysis, design, and implementation<br />
• This is called the modeling methodology<br />
• Methodologies can be <strong>for</strong>mal, prescriptive, step-by-step, documented and auditable or they can be<br />
the opposite: in<strong>for</strong>mal, ad hoc, "seat of the pants" with no trace other than the model artifact itself<br />
• The choice of methodology reflects a personal or philosophical approach <strong>to</strong> analysis, design, and<br />
implementation and can be highly contentious in a project<br />
• So modeling is neither pure intellect nor pure technology – instead, it is best <strong>to</strong> see it as a craft or<br />
skill.<br />
• There is rarely an obvious point at which a model is complete or finished or perfect; it is always a<br />
matter of judgment and must always be based on sometimes arbitrary boundaries about<br />
requirements and scope<br />
5. Methodologies – Disciplines <strong>for</strong> <strong>Modeling</strong> [2]<br />
• A methodology can contain or define:<br />
◦ Meta-models<br />
◦ Processes / Activities / Steps<br />
◦ Notations<br />
◦ Tools<br />
• and how these are applied or fit <strong>to</strong>gether <strong>to</strong> produce:<br />
◦ Artifacts<br />
6. The <strong>Class</strong>ical <strong>Modeling</strong> Approach<br />
• We start with the EXTERNAL view of actual instances, observations, or artifacts<br />
• We then develop a PHYSICAL model that describes the structures and characteristics of the<br />
artifacts as they exist<br />
• From this PHYSICAL model we create a CONCEPTUAL model that abstracts an implementationindependent<br />
view <strong>to</strong> capture the more fundamental structures, characteristics, or relationships on<br />
which the artifacts are based<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 3 of 12<br />
• From this CONCEPTUAL model we can create PHYSICAL models that re-implement the<br />
(presumably more rational, robust) model<br />
7. <strong>Modeling</strong> <strong>for</strong> Analysis<br />
• The primary purpose of modeling is <strong>to</strong> better understand some existing system or environment<br />
and its artifacts ("the things implemented in it") and <strong>to</strong> describe this understanding so it can be<br />
communicated<br />
• This modeling activity is usually called "systems analysis" or simply "analysis"<br />
• A basic task of modeling <strong>for</strong> analysis is capturing the languages and practices of the people who<br />
work with the instances and artifacts in the "real world"<br />
• Any system (especially business ones) has groups of stakeholders who do not fully understand the<br />
"big picture" – an analysis model can be used <strong>to</strong> prevent or repair misunderstandings LIKE<br />
THESE<br />
• An analysis model can synthesize different views or observations in<strong>to</strong> a more complete or generic<br />
perspective that accurately accounts <strong>for</strong> all of them<br />
8. Adapting the <strong>Class</strong>ical Approach <strong>to</strong> XML and Document<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 4 of 12<br />
Engineering [1]<br />
• In "Document Engineering" we can look at artifacts in the world like printed documents or other<br />
things that are tangible<br />
• But what we really care about is the in<strong>for</strong>mation or intangible content about things in the world<br />
that documents contain<br />
• In Document Engineering the instances or implementations on which physical models are based<br />
include printed documents and <strong>for</strong>ms, electronic documents and <strong>for</strong>ms, databases, APIs, and other<br />
actual descriptions of in<strong>for</strong>mation sources<br />
9. Document Instances are External Views<br />
• So we treat document instances as External views in the classical modeling framework<br />
<br />
<br />
Moby Dick<br />
Herman Melville<br />
0804900337<br />
Airmont<br />
<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 5 of 12<br />
10. Schemas are Physical Views<br />
• Document Implementation Models or Document Schemas are what we call Physical views<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
1<strong>1.</strong> <strong>Modeling</strong> <strong>for</strong> Design or Re-Design<br />
• The next purpose of modeling is <strong>to</strong> assist in the design or re-design of a system<br />
• This modeling activity is usually called "systems design" or simply "design"<br />
• Design abstracts away or generalizes from the technology and implementation details in the<br />
physical model<br />
• A model that is implementation-independent is often easier <strong>to</strong> talk about than one that is encoded<br />
in a specific technology context<br />
12. <strong>Modeling</strong> <strong>for</strong> Design or Re-Design – Conceptual Models<br />
• Models of things as they could be are Conceptual or To-Be models<br />
• In Document Engineering the goal of design is <strong>to</strong> create "core components" that describe the<br />
in<strong>for</strong>mation used in a set of documents, databases, <strong>for</strong>ms, APIs in a way that can be used by any<br />
of them<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 6 of 12<br />
1<strong>3.</strong> Adapting the <strong>Class</strong>ical Approach in Document Engineering:<br />
Document Component Models<br />
• Document Component Models describe the complete set of semantic components in a domain,<br />
including their structure and potential relationships with each other<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 7 of 12<br />
14. Adapting the <strong>Class</strong>ical Approach in Document Engineering:<br />
Document Assembly Models<br />
• Document Assembly Models describe how some some selection or arrangement of components in<br />
a hierarchical model of a document type<br />
One Assembly of Previous Component Model<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 8 of 12<br />
Another Assembly of Previous Component Model<br />
15. Manipulating Design Models<br />
• Design models can be manipulated as conceptual objects without impacting the real world that<br />
they describe, or in ways that are impossible in the real world<br />
◦ "What if" simulation under boundary or stress conditions, novel scenarios<br />
◦ Simplifying, reorganizing, or "normalizing" structures<br />
◦ Removing process inefficiencies<br />
◦ Other kinds of pro<strong>to</strong>typing and conceptual experimentation<br />
16. The <strong>Modeling</strong> Gaps<br />
• There is an essential difference or gap between the real world being modeled and the conceptual<br />
world of the model, or else the model would serve no purpose<br />
• Likewise, there is always a gap between an analysis model and a design model, because an<br />
analysis model is often most useful when it isn't tied <strong>to</strong> specific or feasible implementations or<br />
technologies<br />
• But this means we can sometimes see what the current world looks like and what we would like it<br />
<strong>to</strong> be without being able <strong>to</strong> see how <strong>to</strong> get from one <strong>to</strong> the other<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 9 of 12<br />
• This is why some software developers don't like software architects<br />
• Put a different way, this means that models can be designed that are impossible <strong>to</strong> implement<br />
17. Meta-models<br />
• A meta-model is an abstract model that specifies the type of in<strong>for</strong>mation <strong>to</strong> be collected during the<br />
modeling activity<br />
• This is another layer on <strong>to</strong>p of the model itself -- think of it as a model <strong>for</strong> the model<br />
• Rigorous or highly-<strong>for</strong>mal methodologies generally have a meta-model with prescriptive<br />
processes <strong>for</strong> "populating" it<br />
• Meta-models enable models <strong>to</strong> be compared or <strong>to</strong> interoperate<br />
• Examples of meta-models:<br />
◦ template <strong>for</strong> a presentation<br />
◦ the "business transaction" meta-model that defines business processes in terms of pairwise<br />
exchanges of sets of business in<strong>for</strong>mation organized as "business documents"<br />
18. Notations<br />
• A notation is needed <strong>to</strong> depict or represent the objects and processes in your model<br />
• At its simplest, a notation is a set of graphical elements (usually boxes) and lines that connect two<br />
or more of them <strong>to</strong> indicate a relationship<br />
• Notations can be as simple and in<strong>for</strong>mal as "box diagrams" on the back of a napkin<br />
• Or as complex and <strong>for</strong>mal as the "activity diagrams" defined in the Unified <strong>Modeling</strong> Language<br />
(UML)<br />
• There is no single "lingua franca" model notation suitable <strong>for</strong> all users and purposes<br />
• The notation is neither the model nor the thing being modeled – a recipe (the model) can be<br />
presented in a cookbook or demonstrated on a TV show but the food is still the same food<br />
• For any notation, it is essential <strong>to</strong> be explicit about what the boxes and arrows mean, because even<br />
when people use the same "notational vocabulary" they might be using the same symbols <strong>to</strong> mean<br />
different things<br />
19. There Are No <strong>Modeling</strong> Shortcuts<br />
• Some people (but no one taking Document Engineering) think that "modeling" with XML means<br />
"writing a schema given a set of instances" or "inferring a schema from a single instance," like<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 10 of 12<br />
XML Spy tries <strong>to</strong> do.<br />
• But schemas developed without a stage of conceptual design are rarely very useful because they<br />
are <strong>to</strong>o closely tied <strong>to</strong> the particular instances used, which may not be representative.<br />
• Sometimes schemas went through a stage of conceptual design but once the schemas are<br />
implemented the conceptual in<strong>for</strong>mation isn't available <strong>to</strong> schema users; expectation is that the<br />
schemas are sufficient<br />
20. Implementing a Conceptual Model as a Physical One<br />
• A model is purely theoretical until it is encoded in a technology that lets it operate in the real<br />
world again.<br />
• This is a two-stage process: encoding conceptual models as physical ones, and then applying<br />
<strong>for</strong>matting or style trans<strong>for</strong>mations <strong>to</strong> create instances with desired properties<br />
• When instances implemented in different technologies are generated or re-generated from models,<br />
they can more readily interoperate because of their common conceptual components<br />
2<strong>1.</strong> Tools<br />
• Tools can be as simple and in<strong>for</strong>mal (pencil and paper) or complex and <strong>for</strong>mal (CAD and CASE<br />
software)<br />
• There is no single <strong>to</strong>ol suitable <strong>for</strong> all users and purposes<br />
• Tools can be general purpose, not tied <strong>to</strong> specific methodologies (word processors, spreadsheet,<br />
presentation packages)<br />
• General purpose <strong>to</strong>ols can use templates <strong>to</strong> support specific notations or processes<br />
• Tools can be dedicated <strong>to</strong> particular notations or processes<br />
22. Artifacts<br />
• Artifacts are the things that a methodology produces that communicate the results of the modeling<br />
activity<br />
• Models are often communicated as prose documents with some mixture of graphics and text<br />
• Models can be most useful when they are communicated using artifacts that are "notation-neutral"<br />
or that are capable of being trans<strong>for</strong>med in<strong>to</strong> other <strong>for</strong>ms or syntaxes<br />
• A focus on artifacts is a key principle of Document Engineering<br />
2<strong>3.</strong> The <strong>Modeling</strong> Artifacts of Document Engineering<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 11 of 12<br />
• Analyzing the Context –UML use case diagrams<br />
• Analyzing/Designing Business Processes – Worksheets, UML Activity and Sequence Diagrams<br />
• Applying Patterns <strong>to</strong> Business Processes – Document Checklist<br />
• Analyzing Documents – Document Inven<strong>to</strong>ry<br />
• Analyzing Document Components – Consolidated Table of Content Components<br />
• Assembling Document Components – UML <strong>Class</strong> Diagram<br />
• Assembling Document Models – UML <strong>Class</strong> Diagram or Spreadsheet<br />
• Implementing Models – XML Schemas<br />
24. UML as a <strong>Modeling</strong> Notation<br />
• The Unified <strong>Modeling</strong> Language (UML) is a graphical language <strong>for</strong> visualizing, specifying,<br />
constructing and documenting the structure and behavior of (software) systems<br />
• UML is the synthesis of a variety of object-oriented modeling concepts and notations and is now<br />
endorsed by the Object Management Group. It is a language in that it can be used <strong>to</strong> define<br />
different types of models<br />
• UML has a number of standard notations or diagram types that all are based on the same<br />
underlying meta-model (and it can also be used <strong>to</strong> define additional notations)<br />
• Put another way... one UML description of a model can be used <strong>to</strong> produce numerous artifacts that<br />
use different notations, each of which highlights a different aspect of the model<br />
• We will use just enough UML in this course <strong>to</strong> help us analyze and design models <strong>for</strong> documents<br />
and business processes<br />
25. XML as a <strong>Modeling</strong> Notation<br />
• XML has rapidly emerged as a preferred <strong>for</strong>mat <strong>for</strong> creating models that are vendor and notationneutral<br />
• XML's key benefits from this perspective are the ease with which XML instances can be<br />
trans<strong>for</strong>med and the use of models expressed as XML schemas <strong>to</strong> guide code generation by<br />
serving as templates <strong>for</strong> program objects<br />
• Using the concepts introduced in this lecture, XML is a meta-modeling language or maybe even a<br />
meta-meta-modeling language; each XML schema language is a meta-language <strong>for</strong> creating<br />
models that are expressed as DTDs or as instances of other schema language types<br />
• But as we've seen in lectures and assignments XML schema languages impose constraints on the<br />
models they are used <strong>to</strong> create and they may be <strong>to</strong>o low-level in many respects<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005
<strong>3.</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Modeling</strong><br />
Page 12 of 12<br />
26. To Summarize: The Good News About Models<br />
• Models describe a common understanding<br />
• Models help define requirements, identify design weaknesses and design improvements<br />
• Models can facilitate pro<strong>to</strong>typing, reduce development and maintenance costs<br />
• Models can identify reusable patterns and artifacts<br />
27. And the Bad News About Models<br />
• The intellectual challenges of working with abstractions and models and meta-models can become<br />
addictive<br />
• As a result, analysts and designers can engage in endless debates about modeling techniques and<br />
the means of modeling <strong>to</strong>o often become ends in themselves<br />
• Furthermore, many modeling techniques come with either an explicit or implied methodology <strong>for</strong><br />
its application that may be limiting <strong>for</strong> some kinds of models – and so we find ourselves<br />
restricting our designs <strong>to</strong> suit the modeling technique<br />
• Likewise, since approaches <strong>to</strong> modeling reflect personal and philosophical approaches <strong>to</strong><br />
understanding and solving problems the preference <strong>for</strong> a particular modeling technique may lead<br />
it <strong>to</strong> be applied indiscriminately and inappropriately<br />
28. For Next Lecture: Business Patterns and Reuse<br />
• remainder of DE Chapter 3<br />
• Assignment 1: Pattern Scavenger Hunt<br />
file://C:\Documents%20and%20Settings\glushko\My%20Documents\SIMS%20<strong>Courses</strong>\le...<br />
1/26/2005