Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Magritte 2
Magritte 3Im  pro                   Ne     ved                          w
Magritte: Describe once,       get everywhere•   Introspection          • Object persistency•   Reflection                 ...
Why Magritte 3                          All in all the "new" Magritte would look like in the followingFrom: Lukas Renggli ...
Issues with Magritte2• Name collision with #description• class-side description: •   Cache-invalidation •   dynamic descri...
Magritte 3
Magritte 3Descriptions move from class to instance.
Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.
Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All des...
Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All des...
Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All des...
Demo
Magritte 2                  Magritte 3     #description            #magritteDescription  class-side descriptions    instan...
Refactoring supportGofer it  squeaksource: MetacelloRepository;  package: ConfigurationOfMagritte3;  load.ConfigurationOfM...
Refactoring demo
MMAttendee class>>#descriptionBookingDate  ^ MADateDescription new    priority: 30;    label: Booking date;    tooltip: Wh...
MMAttendee class>>#descriptionBookingDate  ^ MADateDescription new    priority: 30;    label: Booking date;    tooltip: Wh...
MMAttendee class>>#descriptionBookingDate  ^ MADateDescription new    priority: 30;    label: Booking date;    tooltip: Wh...
MMAttendee class>>#descriptionBookingDate  ^ MADateDescription new    priority: 30;    label: Booking date;    tooltip: Wh...
Refactoring Move class-side descriptions to instance-sideadd <magritteDescription>Works for description extensions. Operat...
Refactoring will notremove empty class-side categoriesconvert class-side message sends withindescriptions to add classconv...
Porting guidelines1. Use the refactoring support to move class-side   descriptions to instance side descriptions with prag...
StatusAll tests green.Although the API changes appear significant the codechanges within Magritte are less significant and m...
Next steps•   Install:Gofer it    squeaksource: MetacelloRepository;    package: ConfigurationOfMagritte3;    load.Configu...
Load SampleGofer it  url: http://ss3.gemstone.com/ss/MagritteMagic;  package: ConfigurationOfMagritteMagic;  load.(Smallta...
Further information• Seaside Book:  http://book.seaside.st/book/advanced/magritte• Lukass site:    http://www.lukas-renggl...
Upcoming SlideShare
Loading in …5
×

Magritte3

3,119 views

Published on

An introduction to Magritte 3, describing the rational for Magritte 3, the refactoring support available and porting guideline for upgrading to Magritte 3. How to download a Magritte 3 sample

Published in: Technology
  • Be the first to comment

Magritte3

  1. 1. Magritte 2
  2. 2. Magritte 3Im pro Ne ved w
  3. 3. Magritte: Describe once, get everywhere• Introspection • Object persistency• Reflection • Object indexing• Documentation • Object setup• Viewer building • Object verification• Form/Editor building • Object adaption• Report building• Data validation • Object customization• Query processing • and much more
  4. 4. Why Magritte 3 All in all the "new" Magritte would look like in the followingFrom: Lukas Renggli example. Imagine a shop item with the accessor #place: November 2010 Item>>place ^ placeI wrote a proposal this summer of want to proceed on Item>>place: aStringthat, but of course I had to finish my writing and never actually place := aStringfound the time to implement it: The meta-description is defined on the instance-side and annotated. It-------------------- can refer to itself for the possible places:I propose to perform the following (non-backward compatible) changes Item>>placeDescriptionin the Magritte 2 code-base to resolve some major annoyances and <magritte>issues that keep on reoccurring: ^ MASingleOptionDescription new- Move descriptions from class-side to instance-side. This resolves options: self possiblePlaces;various issues such as cache-invalidation, instance specific label: Place of Item;descriptions, dynamic descriptions, context dependent descriptions, accessor: #place;etc. Furthermore the descriptions will be closer to the code they yourselfdescribe and it will be possible to describe class- and instance-sideof an object, not just the instance-side. Class extensions can modify a description using:- Rename the method #description as the default entry point into Item>>placeDescriptionXmlStorage: aDescriptionMagritte to #magritteDescription. This avoids common problems where <magritte: #placeDescription>the domain model already defines such a method. ^ placeDescription xmlTag: xname- Instead of using a naming convention for description methods, use apragma called <magritte> to annotate the methods. And to extend and Since these changes are not backward compatible Ill try to providechange existing descriptions use <magritte: aSelector>. Finally all automatic refactorings for most parts. Moving existing code to the newSmalltalk implementation reached a consensus of pragmas that can be codebase will certainly cause some problems, but in the long run Isafely used cross-platform. believe this to be a much better approach than the current one. If people have any feedback, concerns or other changes that would be important in the same run I am happy to hear them.
  5. 5. Issues with Magritte2• Name collision with #description• class-side description: • Cache-invalidation • dynamic descriptions • instance specific descriptions • context dependent descriptions
  6. 6. Magritte 3
  7. 7. Magritte 3Descriptions move from class to instance.
  8. 8. Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.
  9. 9. Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All descriptions are dynamically generated.
  10. 10. Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All descriptions are dynamically generated.Rename #description to#magritteDescription
  11. 11. Magritte 3Descriptions move from class to instance. Use <magritteDescription> pragmasrather than naming convention.All descriptions are dynamically generated.Rename #description to#magritteDescriptionNon-backward compatible
  12. 12. Demo
  13. 13. Magritte 2 Magritte 3 #description #magritteDescription class-side descriptions instance-side description #descriptionXXX <magritteDescription>#magritteDynamicObject Not required#descriptionContainer <magritteContainer>
  14. 14. Refactoring supportGofer it squeaksource: MetacelloRepository; package: ConfigurationOfMagritte3; load.ConfigurationOfMagritte3 project stableVersion load:Tools
  15. 15. Refactoring demo
  16. 16. MMAttendee class>>#descriptionBookingDate ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourself
  17. 17. MMAttendee class>>#descriptionBookingDate ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourselfMMAttendee>>#descriptionBookingDate ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourself
  18. 18. MMAttendee class>>#descriptionBookingDate ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourselfMMAttendee>>#descriptionBookingDate <magritteDescription> ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourself
  19. 19. MMAttendee class>>#descriptionBookingDate ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: [ Date today ] magritteDynamicObject; yourselfMMAttendee>>#descriptionBookingDate <magritteDescription> ^ MADateDescription new priority: 30; label: Booking date; tooltip: When the attendee booked; accessor: #bookingDate; default: Date today; yourself
  20. 20. Refactoring Move class-side descriptions to instance-sideadd <magritteDescription>Works for description extensions. Operates at a method, class or packagelevelBattle-tested in translating Pier
  21. 21. Refactoring will notremove empty class-side categoriesconvert class-side message sends withindescriptions to add classconvert calls from #description to#magritteDescriptionSimplify Magritte 1 or 2 dynamic description work-aroundsRemove #magritteDynamicObject and it’s associatedblock
  22. 22. Porting guidelines1. Use the refactoring support to move class-side descriptions to instance side descriptions with pragmas - making sure that any accessors to class side methods are either prefixed with ‘class’ or moved to the instance side.2. remove #magritteDynamic and remove the block around the method.3. search for all senders and implementors of #description in your code, if they are magritte descriptions rename the selector from #description to #magritteDescription 4. Remove any empty categories on the class side.
  23. 23. StatusAll tests green.Although the API changes appear significant the codechanges within Magritte are less significant and mainlylocalised to MAPragmaBuilderPier has been ported to Magritte 3 (Pier 3) and is stable.Magritte-Json and Magritte-XMLBinding portedOther Magritte add-ons such Magritte-JQuery un-portedNo performance testing - descriptions are no longercached. Is this significant in the context of an application?
  24. 24. Next steps• Install:Gofer it squeaksource: MetacelloRepository; package: ConfigurationOfMagritte3; load.ConfigurationOfMagritte3 project stableVersion load:Seaside.Gofer it squeaksource: MetacelloRepository; package: ConfigurationOfMagritte3AddOns; load.ConfigurationOfMagritte3 project stableVersion load.• Use the refactoring tools to move to Magritte 3.• Profile performance within your application.
  25. 25. Load SampleGofer it url: http://ss3.gemstone.com/ss/MagritteMagic; package: ConfigurationOfMagritteMagic; load.(Smalltalk at: #ConfigurationOfMagritteMagic) load.
  26. 26. Further information• Seaside Book: http://book.seaside.st/book/advanced/magritte• Lukass site:   http://www.lukas-renggli.ch/smalltalk/magritte• Magritte/Pier mail list: <smallwiki@iam.unibe.ch>

×