170 likes | 338 Views
Model-View-Controller Architecture Specific Model Transformation. Hiroshi Kazato 1,2 , Rafael Weiss 1 , Shinpei Hayashi 1 , Takashi Kobayashi 3 and Motoshi Saeki 1 1 NTT DATA CORPORATION 2 Tokyo Institute of Technology {kazato,rweiss,hayashi,saeki}@se.cs.titech.ac.jp 3 Nagoya University
E N D
Model-View-Controller Architecture SpecificModel Transformation Hiroshi Kazato1,2, Rafael Weiss1, Shinpei Hayashi1,Takashi Kobayashi3 and Motoshi Saeki1 1 NTT DATA CORPORATION 2 Tokyo Institute of Technology {kazato,rweiss,hayashi,saeki}@se.cs.titech.ac.jp 3 Nagoya University tkobaya@is.nagoya-u.ac.jp DSM'09
Agenda • Introduction • MotivatingExample • Solution: Pivot Technique • MVC-specificModelTransformation • PIMProfile • PIM-to-PSMTransformation • Process & Tool Chain • CaseStudy • RelatedWork • Conclusion DSM'09
Introduction • Variousplatforms(frameworksandlibraries)canbeusedtobuilduser-interactiveapplication • e.g.EJB,Struts,Spring,Hibernate,JSF • Coming one after another, introducing somehow familiar concepts in brand-new names • Generative UML/MDA tools seemed promising to bring interoperability of designmodels • e.g.AndroMDA, openArchitectureWare • UML profiles and code generators took over from platforms DSM'09
MotivatingExample • Modelmigration:EJB → Spring+Hibernate (a)UMLwithEJBprofile (b)UMLwithSpring+Hibernateprofiles DSM'09
Solution:PivotTechnique • Provideanintermedieatemetamodel(“pivot”)anditsmappingstoconcretemetamodels. • HowcanIdefinesuch apivotforuser-interactiveapplications? concrete metamodels model-to-model transformation “pivot” metamodel mm3 mmpv mm2 mm1 instance of Instance of m3 mpv Instance of m2 Instance of m1 DSM'09
Model-View-Controller • Architecturestylewhichdefinestypical structure and behavior of auser-interactive application • «model» provides core functionalities(i.e.logicanddata) • «view» showsinformation to auser • «controller» interprets user operationsas a request to perform somefunctionalityon the «model» Observer +update() Model View -coreData +initialize(model : Model) -myModel +attach(observer : Observer) +makeController() +detach(observer : Observer) +activate() +notify() +display() Controller -myView -myController +getData() +update() +service() +initialize(model : Model, view : View) +handleEvent() +update() Buschmann etal.“Pattern-Oriented Software Architecture: A System of Patterns”,Wiley & Sons, 1996 DSM'09
CategorizingPlatforms DSM'09
PIMModeling • Restrict desginmodel into Model-View-Controller architecture style • MVCProfile(“ACCURATE “) • «model» • «view» • «controller» • «external» DSM'09
PIM-to-PSMTransformation mapping Class::toPSMClass() : Class { name := self.name.firstToUpper(); isAbstract := self.isAbstract; visibility := self.visibility; ... ownedAttribute := self.ownedAttribute->map toProperty()->asOrderedSet(); ownedOperation := self.ownedOperation->map toOperation()->asOrderedSet(); } mapping Class::toService():Classinherits Class::toPSMClass when{ self.isStereotypeApplied(ACCURATE::controller) }{ end { result.applyStereotype(Spring2::Service);} } Basicmapping Modify stereotype DSM'09
Process&ToolChain MagicDraw M2MQVTo oAW Fornax-Platform DSM'09
CaseStudy • Addressbook • create/save/openaddressbook • add/edit/deleteentries DSM'09
FirstGeneration • Platform:Hibernate+Swing+POJO DSM'09
SecondGeneration • Platform:Hibernate+Swing+Spring DSM'09
RelatedWork • ATLProject[7] • Pivottechnique • ATLAStransformation language • GignoMDA[11] • DefinesPIM profilesfordatabaseapplication • GenerateEclipseRCPbaseddatabaseapplicationusingAndroMDA • Focusingoncross-layeroptimizatonofdatabaseapplications DSM'09
Conclusion • Summary • Defined a “pivot” forMVCbasedapplicationusing a UML profile and QVTtransformations • Employed MVC concepts in order to categorize various platforms and findtransformationmappings • Futureworks • Furtherevaluation • Platformdecisionmodel • Interoperationwithcoding(e.g.reversemapping) DSM'09
Thankyou. • Anyquestions? DSM'09