advertisement

Magritte

100 %
0 %
advertisement
Information about Magritte

Published on February 27, 2008

Author: renggli

Source: slideshare.net

advertisement

Magritte [René Magritte, 1966] Decalcomania www.lukas-renggli.ch Software Composition Group University of Bern

Lukas Renggli ! Academics – PhD Student, University of Bern ! Industry – Independent Software Consultant ! Communities – Core-developer of Seaside – Author of Magritte and Pier

Agenda ! Introduction and Example ! History and Usage ! Implementation Details ! Adaptive Models

Magritte Introduction and Example Describe once, Get everywhere

Address Object :Address street = 'Schützenmattstrasse' plz = 3012 place = 'Bern' canton = 'Bern'

Address Class :Address Address street = 'Schützenmattstrasse' class street: String plz = 3012 plz: Integer place = 'Bern' place: String canton = 'Bern' canton: String

Address Description :StringDescription label = 'Street' :NumberDescription label = 'PLZ' required = true :Address range = 1000..9999 street = 'Schützenmattstrasse' description :StringDescription :Container plz = 3012 label = 'Place' label = 'Address' place = 'Bern' required = true canton = 'Bern' :SingleOptionDescription label = 'Canton' required = true sorted = true options = #( 'Bern' 'Zurich' ... )

Address Description Magritte :StringDescription label = 'Street' :NumberDescription label = 'PLZ' required = true :Address range = 1000..9999 street = 'Schützenmattstrasse' description :StringDescription :Container plz = 3012 label = 'Place' label = 'Address' place = 'Bern' required = true canton = 'Bern' :SingleOptionDescription label = 'Canton' required = true sorted = true options = #( 'Bern' 'Zurich' ... )

Describe (1) Address class>>#descriptionStreet ! ^ MAStringDescription new ! ! autoAccessor: #street; ! ! label: 'Street'; ! ! priority: 100; ! ! yourself Address class>>#descriptionPlz ! ^ MANumberDescription new ! ! autoAccessor: #plz; ! ! priority: 200; ! ! label: 'PLZ'; ! ! beRequired; ! ! min: 1000; ! ! max: 9999; ! ! yourself

Describe (2) Address class>>#descriptionPlace ! ^ MAStringDescription new ! ! autoAccessor: #place; ! ! label: 'Place'; ! ! priority: 300; ! ! beRequired; ! ! yourself Address class>>#descriptionCanton ! ^ MASingleOptionDescription new ! ! options: #('Zuerich' 'Bern' 'Luzern' ...); ! ! autoAccessor: #canton; ! ! label: 'Canton'; ! ! priority: 400; ! ! beRequired; ! ! beSorted; ! ! yourself

Interpret (1) anAddress description do: [ :description | Transcript show: description label; show: ':'; tab; show: (description toString: (anAddress readUsing: description)); cr ] Street:! Schutzenmattstrasse PLZ:! 3012 Place:! Bern Canton:! Bern

Interpret (2) result := anAddress asMorph ! addButtons; ! addWindow; ! callInWorld

Interpret (3) result := self call: (anAddress asComponent addValidatedForm; yourself). * * *

What is it used for? ! Reflection ! Object filtering – Introspection ! Object serialization – Intercession ! Object copying ! Viewer building ! Object indexing ! Editor building ! Object initialization ! Report building ! Object verification ! Documentation ! Object adaption ! Data validation ! Object customization ! Query processing and much more ...

Why is it useful? ! Describe once, get everywhere. ! Extensibility of classes is ensured. ! Context dependent descriptions. ! End-user customizable. ! Developer configurable.

Why is it cool? ! Describe once, get everywhere. ! Be more productive. ! Lower coupling. ! Empower your users. ! Do more, with less code. ! Do more, with less hacking.

It seems a drag to me that you need to add 22 14 class categories of Magritte, [...] I’d rather avoid Magritte. It’s a PhD Master thesis, and so not optimized for simplicity. People who use it, love it, I suppose. Probably makes them feel smart. — Chris Cunnington

Magritte History and Usage Describe once, Get everywhere

SmallWiki started as University Project 2002 SmallWiki released 2003 1st price in Started with SmallWiki 2 ESUG Innovation (meta-model based) Technology Awards 2004 Changed development from VisualWorks to Squeak Extracted 1st commercial SqueakMap Magritte Magritte Application release 2005 Changed product name from SmallWiki to Pier Magritte: Meta-Described Web Application Development 2006 3rd price in ESUG Innovation seaside.st Technology Awards 2007 Magritte: A Meta-Driven Approach to Empower Developers and End Users Magritte on WikiPedia 2008

Aare Workflow definition and runtime system

Magritte Implementation Details Describe once, Get everywhere

Descriptions ! Problem – Objects and their values all need to be treated differently. ! Example – Boolean and String are not polymorphic, therefore different code for certain operations is necessary. ! Solution – Introduce a descriptive hierarchy that can be instantiated, configured and composed.

Type Object Component Component Type 1 * 1 1 (a) Type-Square * * Property Property Type 1 * Type Object [Yoder et al, 2001] Architecture and design of adaptive object models

attributes attributes 1 1 * attributes * 1 Object * Object * * Object * description description Object Object Type Type description Object Type attributes Description * Description * * 1 Description [Renggli et al, 2007] Magritte — A Meta-Driven Approach to Empower Developers and End Users *

attributes attributes 1 1 * attributes * 1 Object * Object * * Object * description description Object Object Type Type description Object Type attributes Description * Description * * 1 Description [Renggli et al, 2007] Magritte — A Meta-Driven Approach to Empower Developers and End Users *

attributes attributes 1 1 * attributes * 1 Object * Object * * Object * description description Object Object Type Type description Object Type attributes Description * Description * * 1 Description [Renggli et al, 2007] Magritte — A Meta-Driven Approach to Empower Developers and End Users *

Descriptions Composite pattern to describe model-instances. Accessor Description Condition children Container ElementDesc. StringDesc. BooleanDesc.

Descriptions reference Description children Container ElementDesc. ColorDesc. MagnitudeDesc. StringDesc. BooleanDesc. ReferenceDesc. DateDesc. NumberDesc. OptionDesc. RelationDesc. SingleDesc. MultipleDesc. ToOneDesc. ToManyDesc.

Accessors ! Problem – Data can be stored and accessed in different ways. ! Examples – Accessor methods, chains of accessor methods, instance-variables, dictionaries, derived values, external values, etc. ! Solution – Provide a strategy pattern to be able to access data through a common interface.

Accessors Strategy pattern to access model-entities. next, accessor Accessor Cascade Selector Dictionary Block Null Auto

o: Object d: Description a: Accessor readUsing: d accessor read: o <strategy a> write: v using: d accessor write: v to: o <strategy a>

Mementos ! Problems – Editing might turn a model (temporarily) invalid. – Canceling an edit shouldn’t change the model. – Concurrent edits of the same model should be detected and (manually) merged. ! Solution – Introduce mementos that behave like the original model and that delay modifications until they are committed.

Mementos Memento pattern to cache model-entities. description model Description Memento Object cache Strait Cached Dictionary original Checked Dictionary

Magritte Adaptive Models Describe once, Get everywhere

Rapidly changing requirements

Adaptive Model + copy() descriptions values Object Description

End users would know their requirements

attributes attributes 1 1 * attributes * 1 Object * Object * * Object * description description Object Object Type Type description Object Type attributes Description * Description * * 1 Description [Renggli et al, 2007] Magritte — A Meta-Driven Approach to Empower Developers and End Users *

Meta- Metamodel <described-by> Metamodel Developer <described-by> Domain Model End User

Meta- Metamodel <described-by> Metamodel Magritte Developer <described-by> Domain Model Magritte End User

Demo

Conclusion ! Describe once, get everywhere. ! Ensure extensibility and maintainability. ! Automate repetitive tasks. ! End-user customizability. ! (Run-time) adaptive object model.

Add a comment

Related pages

René Magritte – Wikipedia

Leben. René Magritte war der erstgeborene Sohn des Schneiders Leopold Magritte und der Hutmacherin Régina Bertinchamp. Er hatte zwei Brüder, Raymond ...
Read more

René Magritte - Wikipedia, the free encyclopedia

Magritte's work frequently displays a collection of ordinary objects in an unusual context, giving new meanings to familiar things. The use of objects as ...
Read more

Rene Magritte Poster bei AllPosters.de

Rene Magritte Poster bei AllPosters.de. Über 500.000 Poster – Individuelle Rahmen, Schnelle Lieferung und 100% Zufriedenheitsgarantie.
Read more

René Magritte Biografie - Informationen - Kauf-Angebote

Der belgische Maler René Magritte wird am 21.11.1898 in Lessines, einer Kleinstadt in der Provinz Hainaut, geboren. 1910 zieht die Familie nach Châtelet ...
Read more

Magritte – Wikipedia

Magritte ist der Name von. René Magritte (1898–1967), belgischer Maler des Surrealismus; Magritte bezeichnet. Magritte (Filmpreis), belgischer Filmpreis
Read more

Magritte Rene Poster auf Poster.de

Magritte Rene Poster auf Poster.de. Hat diese Galerie Sie inspiriert? Weitere Poster, Kunstdrucke und spezielle Produkte finden Sie auf Poster.de.
Read more

René Magritte — Wikipédia

René Magritte, par Lothar Wolleh . Naissance 21 novembre 1898 à Lessines Décès 15 août 1967 (à 68 ans) à Schaerbeek Nom de naissance René François ...
Read more

Magritte | ARTinWORDS

Kein Frühwerk – Magritte surreal. Die Ausstellung der Albertina spart das Frühwerk des belgischen Künstlers René Magritte völlig aus. Bereits im ...
Read more

Magritte | Skulpturen | Pinterest | Bronze, Rene Magritte ...

Beat Kühne hat diesen Pin entdeckt. Entdecke (und speichere) deine eigenen Pins bei Pinterest. | Weitere Informationen über Bronze, Rene Magritte und ...
Read more

Magritte: Kleine Reihe - Kunst: Amazon.de: Marcel Paquet ...

Marcel Paquet - Magritte: Kleine Reihe - Kunst jetzt kaufen. 2 Kundrezensionen und 4.5 Sterne. Bildende Kunst, Art /…
Read more