Method Engineering 2007 Keynote (Kelly) Engineering... · Introducing Domain-Specific...
Transcript of Method Engineering 2007 Keynote (Kelly) Engineering... · Introducing Domain-Specific...
© 2007MetaCase 1
Domain-Specific Modelling:The Killer App for Method Engineering?
12th September 2007
9:30 — 10:30
Steven Kelly, MetaCase
© 2007MetaCase 2
1
10
100
1,000
10,000
100,000
1,000,000
10,000,000
100,000,000
1,000,000,000
10,000,000,000
1950 1960 1970 1980 1990 2000
programmers
computers
Moore
Exponential growth is not smooth
� Moore: 18 months
� Computer: 33
� Programmer: 88
� 1980s PC revolution
� 2000 mobile revolution
� Computers/user:
– 1970: 1:10
– 2010: 10:1
� Customise with software
� Software crisis worsening!
© 2007MetaCase 3
How has productivity improved?
� "The entire history of software engineering is that of the rise in levels of abstraction"
Grady Booch
� New programming languages have not increased productivity
� UML and visualization of code have not increased productivity
� Abstraction of development can be raised above current level...
� ... and still generate full production code (and ignore it!)
*Software Productivity Research & Capers Jones, 2002
© 2007MetaCase 4
Contingency theory and software development
� One size does not fit all: Diversity due to:
– type of systems built
– technology used to implement them
– organizations, cultures, tools etc.
� Laboratory studies show that developers understand and use methods differently
– Extend, give new meanings, create own interpretations etc. for modeling constructs (e.g. in studies by Wijers, Verhoef)
� Contingency theory advocates flexible languages:no single language gives best result in all situations
– IFIP WG conferences (Olle et al. 1982, -83, -86, -88)
� Empirical studies show that companies prefer own methods
– 2/3 use internal, home-grown methods, Russo et al., Fitzgerald
� Create your own modeling language and generators?
– Domain-Specific Modelling
© 2007MetaCase 5
What is Domain-Specific Modelling?
Introducing Domain-Specific Modelling (DSM)
Where to apply – and why
Real life examples from various domains
© 2007MetaCase 6
DomainIdea
FinishedProduct
Solve problem in domain term
s
AssemblerMap to code, implement
UML ModelMap to UML
Generate,Add bodies
Domain Framework
Model inDSM
language
Generate codeNo need
to map!
CodeMap to code, implement
Modelling functionality vs. modelling code
© 2007MetaCase 7
Why is the vision possible (now)?
� Need to fit only one company’s requirements!
� Modelling is Domain-Specific (unlike 90’s UML)– Works for one company / product group,
application domain / framework / product family
– Language has concepts people are already familiar with
– Models used to solve the problem, not to visualize code
� Generator is Domain-Specific (unlike 80’s CASE)– Generate just the code needed from models
• Efficient full code
• No manual coding afterwards
• No reason for round-tripping
– Generator links to existing primitives/components/platform services etc.
– Can generate 3GL, Assembler, object-oriented, XML, etc.
© 2007MetaCase 8
Real-life cases, various domains
� Insurance products & eCommerce Java
� VoiceMenu for microcontroller Assembler
� Business Process Modelling for XPDL XML
� Call Processing Language XML
� Web application Java, XML
� Robotics C
� Infotainment systems
� Enterprise apps in Smartphones Python
� Symbian native applications C++
� IMS Service Creation
© 2007MetaCase 9
Insurance products & eCommerce ���� Java
© 2007MetaCase 10
VoiceMenu for microcontroller ���� Assembler
© 2007MetaCase 11
Business Process Modelling for XPDL ���� XML
© 2007MetaCase 12
Call Processing Language ���� XML
© 2007MetaCase 13
Web application ���� Java, XML
© 2007MetaCase 14
Robotics ���� C
© 2007MetaCase 15
Infotainment systems
© 2007MetaCase 16
Enterprise apps in Smartphones ���� Python
© 2007MetaCase 17
.RSS
.HRH
.PKG
.MMP
.INF
....
.LOC
.CPP
.H
Symbian native applications ���� C++
© 2007MetaCase 18
IMS Service Creation
© 2007MetaCase 19
Where to apply?
� Repetitive development tasks
– Large portion of the work similar to earlier products
– Several products made in parallel
– Useful to narrow down the design space
� Domain expertise needed
– Non-programmers can participate
� These normally include:
– Product Family
– Platform-based development
– Configuration
– Business rule definitions
– Embedded devices
© 2007MetaCase 20
Tools for DSM:Building a modeling language —i.e. real Method Engineering!
© 2007MetaCase 21
DomainIdea
FinishedProduct
Model inDSM
language
Easy!Normal(many)
Done a few times before!
Codegenerator
DSMlanguage
Frameworkcode
How to implement DSM
Domain Framework
Generate code
Expert(few)
© 2007MetaCase 22
Tools for DSM creation and use
� 6 ways to get the tools we need for DSM
1. Write own modelling tool from scratch
2. Write own modelling tool based on frameworks
3. Metamodel, generate modelling tool skeleton, add code
4. Metamodel, generate full modelling tool over a framework
5. Metamodel, output configuration for generic modelling tool
6. Integrated modelling and metamodelling environment
� Good tools minimize resource use (few man-weeks)
– create modelling tools automatically
– guide in DSM creation
– allow you to test DSM throughout domain design process
� Good tools allow DSML to evolve
© 2007MetaCase 23
A Brief History of Tools
� Tools for textual languages (late 70’s ->)
– SEM (Teichroew and Yamato)
– Others include Plexsys, Metaplex, Quickspec, PSL/PSA
� Tools for graphical languages (mid 80’s)
– Swedish Ramatic: set theory for metamodeling
– British Eclipse (not THAT Eclipse!): directed graphs
� Tools for graphical metamodeling (late 80’s)
– Finnish Metamodeling Editor MetaEdit: OPRR
� + dozens of others over the years: MetaView, Kogge, Virtual Software Factory, Paradigm+ SDK, Customizer in Excelerator, IPSYS ToolBuilder, ConceptBase, Dome, GME etc.
– Most of the tools focus on initial language specification and editor construction
© 2007MetaCase 24
Currently many 'version 1.0' tools— again!
� Single user
� Single modelling language at a time
� Simple metamodels
– Focus on objects, basic properties, binary relationships
� Simple notation
– Single graphical element + label
� Generator is text-to-text
– Or hand-written code to read models
� Resulting modelling tool primitive
– Missing majority of functions users expect in such a tool
� Upgrading modelling language invalidates models
� Upgrading tool framework invalidates tool
© 2007MetaCase 25
MetaEdit+ Eclipse EMF+GEF
1 hour 10kLOC=1yr=2000hComparison of EMF+GEF and MetaEdit+ for DSM, MDSD Workshop, OOPSLA ’04
© 2007MetaCase 26
MetaEdit+ Eclipse EMF+GEF/* Abridged version of LED.java, showing just parts related to property value. *//* Whole file is 3 times as long. In total, the 4 LED classes are 663 lines. */package org.eclipse.gef.examples.logicdesigner.model;import org.eclipse.gef.examples.logicdesigner.LogicMessages;import org.eclipse.ui.views.properties.IPropertyDescriptor;import org.eclipse.ui.views.properties.PropertyDescriptor;import org.eclipse.ui.views.properties.TextPropertyDescriptor;public class LED
extends LogicSubpart{public static String P_VALUE = "value"; protected static IPropertyDescriptor[] newDescriptors = null;static{
PropertyDescriptor pValueProp = new TextPropertyDescriptor(P_VALUE, LogicMessages.PropertyDescriptor_LED_Value);
pValueProp.setValidator(LogicNumberCellEditorValidator.instance());if(descriptors!=null){
newDescriptors = new IPropertyDescriptor[descriptors.length+1];
for(int i=0;i<descriptors.length;i++)newDescriptors[i] = descriptors[i];
newDescriptors[descriptors.length] = pValueProp;} else
newDescriptors = new IPropertyDescriptor[]{pValueProp};}public Object getPropertyValue(Object propName) {
if (P_VALUE.equals(propName))return new Integer(getValue()).toString();
if( ID_SIZE.equals(propName)){return new
String("("+getSize().width+","+getSize().height+")");}return super.getPropertyValue(propName);
}public void resetPropertyValue(Object id){
if (P_VALUE.equals(id))setValue(0);
super.resetPropertyValue(id);}public void setPropertyValue(Object id, Object value){
if (P_VALUE.equals(id))setValue(Integer.parseInt((String)value));
elsesuper.setPropertyValue(id,value);
}}
/* Abridged version of LEDFigure.java, showing just unselected symbol display. */
/* Whole file is 4 times as long, plus 65 lines for dragged symbol display. */
protected void paintFigure(Graphics g) {
Rectangle r = getBounds().getCopy();
g.translate(r.getLocation());
g.setBackgroundColor(LogicColorConstants.logicGreen);
g.setForegroundColor(LogicColorConstants.connectorGreen);
g.fillRectangle(0, 2, r.width, r.height - 4);
int right = r.width - 1;
g.drawLine(0, Y1, right, Y1);
g.drawLine(0, Y1, 0, Y2);
g.setForegroundColor(LogicColorConstants.connectorGreen);
g.drawLine(0, Y2, right, Y2);
g.drawLine(right, Y1, right, Y2);
// Draw the gaps for the connectors
g.setForegroundColor(ColorConstants.listBackground);
for (int i = 0; i < 4; i++) {
g.drawLine(GAP_CENTERS_X[i] - 2, Y1, GAP_CENTERS_X[i] + 3, Y1);
g.drawLine(GAP_CENTERS_X[i] - 2, Y2, GAP_CENTERS_X[i] + 3, Y2);
}
// Draw the connectors
g.setForegroundColor(LogicColorConstants.connectorGreen);
g.setBackgroundColor(LogicColorConstants.connectorGreen);
for (int i = 0; i < 4; i++) {
connector.translate(GAP_CENTERS_X[i], 0);
g.fillPolygon(connector);
g.drawPolygon(connector);
connector.translate(-GAP_CENTERS_X[i], 0);
bottomConnector.translate(GAP_CENTERS_X[i], r.height - 1);
g.fillPolygon(bottomConnector);
g.drawPolygon(bottomConnector);
bottomConnector.translate(-GAP_CENTERS_X[i], -r.height + 1);
}
// Draw the display
g.setBackgroundColor(LogicColorConstants.logicHighlight);
g.fillRectangle(displayHighlight);
g.setBackgroundColor(DISPLAY_SHADOW);
g.fillRectangle(displayShadow);
g.setBackgroundColor(ColorConstants.black);
g.fillRectangle(displayRectangle);
// Draw the value
g.setFont(DISPLAY_FONT);
g.setForegroundColor(DISPLAY_TEXT);
g.drawText(value, valuePoint);
}
© 2007MetaCase 27
What is needed in a mature tool?
� Meta-metamodel concepts– Explicit concepts for Graph, Role, Port
– N-ary relationships
� Constraints– Easy & powerful for relationships, property values
– Language for arbitrary constraints
� Model integration– Objects as property values
– Reuse of objects across models
– Links to subgraphs
� Notation and modelling tool functionality– Models automatically update when metamodel changes
� Purpose-built generator language and tools
© 2007MetaCase 28
Research Issues and Challenges
� Reuse
– Whole models and individual model elements
– Sequential and parallel
– Tool support for modeller vs. rules by metamodeller
� Versioning
– Metamodel level, upgrading the language
– Model level, with graphical diff
� Scaling
– Multiple users, concurrency vs. split & merge
– Multiple projects, sequential and parallel
� These all conflict with each other!
– At least if we try to apply familiar code-based practices
© 2007MetaCase 29
Roadmap hints for ME research
1. Understanding the state of the art
– mature tools
– previous research
2. Empirical research on the use of DSM in the field
3. Condensing 1 & 2 into advice for method engineers
4. Hypothesizing from 1 & 2 a set of new requirements for the next generation of tools
� Prerequisites for success:
– Don’t skip steps!
– Industry maturing past ”everything is UML”
– Academia going beyond ”ME = mix&match existing bits”
© 2007MetaCase 30
Try MetaEdit+ for free, buy your own for 150€,get 20 for 50€ each!
MetaCase
Ylistönmäentie 31FI-40500 Jyväskylä, Finland
Phone +358 14 4451 400, Fax +358 14 4451 405www.metacase.com
Thank you!
© 2007MetaCase 31
Further reading� Brinkkemper, S., Lyytinen, K., Welke, R., Method Engineering – Princi-
ples of method construction and tool support, Chapman & Hall, 1996.
� Czarnecki, K., Eisenecker, U., Generative Programming, Methods, Tools, and Applications, Addison-Wesley, 2000.
� Gray, J., Rossi, M., Tolvanen, J-P, (eds.) Special issue of Journal of Visual Languages and Computing on Domain-Specific Modelling with Visual Languages, Vol 15 (3-4), 2004.
� Kelly, S. & Tolvanen, J.-P., Domain-Specific Modeling, Wiley, 2008
� Kieburtz, R. et al., A Software Engineering Experiment in Software Component Generation, Proceedings of 18th International Conference on Software Engineering, Berlin, IEEE Computer Society Press, 1996.
� Pohjonen, R., Kelly, S., Domain-Specific Modelling, Dr. Dobb's, 8, 2002.
� Tolvanen, J.-P., Pohjonen, R., Automated Production of Family Members: Lessons Learned. Proceedings of International workshop of Product Line Engineering, Technical Report at Fraunhofer IESE (eds. K. Schmid, B. Geppert) 2002.
� Weiss, D., Lai, C. T. R., Software Product-line Engineering, Addison Wesley Longman, 1999.