Upload
duongxuyen
View
214
Download
0
Embed Size (px)
Citation preview
Dr. Marko Boger
GentlewareGentleware
Founded in 2000 by M. BogerOffspring from University researchTeam of 10 EmployeesOpen Source-based
ArgoUMLNSUML, Netbeans, Velocity, xDoclets, DocBook, Ant, Xalan, Xerxes, OCL, CreazyBeans,
Profitable
Dr. Marko Boger
Poseidon Poseidon for for UMLUML
Launch November 2001Free Community EditionOver 125.000 downloads2 Commercial Editions• Standard Edition• Professional Edition
Focus on UsabilityStandard-compliantFlexible Code Generation
Dr. Marko Boger
The Value The Value of of UML ModelsUML Models
What to do with UML Models?Send to a colleque for implementationSend to a partner for coordinationSend to a standardization committee
Generate documentationGenerate codeGenerate XML schema
Dr. Marko Boger
The Value The Value of of InterchangeInterchange
Model ExchangeCommunicate from one Organization to another
Investment securityMigrate from one Vendor to another
Value-adding Chains of ToolsWhiteboard toolModeling toolCode Generation toolsValidation, Testing and Verification tools
Dr. Marko Boger
XMIXMI
XML Metadata Interchange (XMI)Based on XML Standardized by OMGUsed for highly referential Data E.g. MetadataProductions rules for MOF
Supported by many VendorsSaving Format of Poseidon
Dr. Marko Boger
Problems Problems with with XMIXMI
Problems with XMIDifferent Versions of XMI (1.0 – 1.2)Different Versions of MOF (1.0 – 1.4)Different Versions of UML (1.1, 1.3, 1.4)Different Interpretations Faulty Implementations
No Diagram InformationOnly the Model Information is included
RFP for Diagram Interchange by OMG
Dr. Marko Boger
RFP RFP Diagram Diagram InterchageInterchage
RFP for UML 2.0Three Initial Submissions
Rational Sun, CompuwareGentleware, Telelogic, Adaptive, DaimlerChrysler
Joint Revised SubmissionFirst Revised Submission Sept. 9, 2002Final Revised Submission Jan. 6, 2002Supported by TogetherSoft, I-Logix, Softeam, KC
Dr. Marko Boger
Tool Chain Tool Chain ExampleExampleW
hite
boar
d to
ol,
Mod
elin
g to
ol,
Code
Gen
erat
or
Dr. Marko Boger
Model-orientedModeling tools, Code GeneratorNeed Layout informationSemantic understandingDiffering representationsModel editing
Graphic-orientedWord Processing, Presentations, PublishingNeed precise GraphicNo Semantic understandingExact representationOnly graphical editing
XMIDiagram MetamodelGraph-based
SVGLines and BoxesGraphic-based
XSLT
Responding Responding to to Different Different NeedsNeeds
Dr. Marko Boger
Key Key Ideas Ideas
Graph-oriented Metamodel for UML and other DiagramsUnchanged UML MetamodelExtension of XMI
XMI[UML]XMI[DI]XMI[UML+DI]
XMI for Model-oriented toolsSVG for Graphic-oriented tools
Dr. Marko Boger
DemoDemo
View UML model Save as XMI [UML+DI]Transforme to SVG using XSLTView SVG in Browser
Dr. Marko Boger
The Value The Value of of Code GenerationCode Generation
Generate to different PlatformsJava / General ApplicationEJB / Business ApplicationC / Embedded Systems
Generate documentationHTMLPDF /DocBookManagement information / Metrics
The Foundation for MDA
Dr. Marko Boger
Increased Increased Importance of Code Importance of Code
GenerationGenerationCORBA MDA
IDL
C++ Java
Business LogicCoding
Platform specific
UMLAnalysis, Static Structure
Code Gen.
Platform specific
UMLAnalysis, Static Structure
C++ Java
XMI
Business LogicProcess, Behaviour,Test, Tracing
Code Gen.
Dr. Marko Boger
Code GenerationCode Generation
Template-basedVelocity Project of ApacheTemplate-Language
• #if• #foreach• Variables: $var• Java Classes: $myClass
Design an examle file• Java, C++, HTML, XML, XML-Schema
Replace variable parts with model info.
Dr. Marko Boger
Example for Example for HTMLHTML
<HTML><BODY>Hello $customer.Name!<table>
#foreach( $product in $catalog.productlist )#if ( $customer.hasPurchased($product) )
<tr><td>
$product.getTitle( )</td>
</tr>#end
#end</table>
<HTML><BODY>
Hello Marko Boger!<table>
<tr><td>
Poseidon for UML</td>
</tr><tr>
<td>UMLdoc Plugin
</td></tr>
</table>
Dr. Marko Boger
How How Velocity Velocity worksworks
Establish Context, use in Templates
Context
public class $clazz.getName() {#foreach( $attribut in $attributes)private $attribut;
#end}
Template
public class Car {private kfz;private color;
}
clazz
...
attributes Vector attributes = {kfz, color}
MClassifier clazz = new MClassifierImpl(“Car“)
Java
Dr. Marko Boger
Changing TemplatesChanging Templates
Add simple metric to each classCount number of methods. If too many, generate a warning in header
/** Java class "${className}.java" generated from Poseidon for UML.* Poseidon for UML is developed by Gentleware.* Generated with velocity template engine.*/#if (preparedOperations.size()>10)
// This class has too many operations. Consider a refactoring.#end
#if ($package != "")package $package;#end
#renderImports($imports)
#renderClassSignature($preparedClassifier)
Dr. Marko Boger
Changing TemplatesChanging Templates
Add log information to MethodCall Logmanager before every method call
#macro (renderOneOperation $currentOp $editable)$currentOp.getDocs()${visibility}${static}${final}${returnType} ${name}($inOutPars)$thrownClause {
LogManager.log.info("calling method ${name}()");#renderMethodBody($currentOp.getMethodBody() $currentOp.hasReturnType())
} // end ${name}#end