EMF.Edit
                                                                             The Force Unleashed!




                                                                                            Mikaël Barbero
                                                                                                     Obeo
cloudchaser32000 (cc) http://www.flickr.com/photos/22566089@N03/5983182747/
Did you ever code a rich
   client application:


 - without EMF?


  - with EMF?
What is   EMF   ?
From
                                                                Models...



(cc) Alan Dean http://www.flickr.com/photos/60041018@N00/3513723662
...to Java Beans




(cc) The Wanderer's Eye http://www.flickr.com/photos/8997331@N04/5237447939
(cc) Tama Leaver http://www.flickr.com/photos/75815807@N00/2409717875




 On
 Steroïds
(cc) Яick Harris http://www.flickr.com/photos/37153080@N00/430890004
(cc) Sterlic http://www.flickr.com/photos/27482959@N08/5559534294




More about the
Steroïds
EMF.Edit


(cc) alexliivet http://www.flickr.com/photos/23108377@N07/7018977935
Notify
                         (cc) shankar, shiv http://www.flickr.com/photos/14722496@N04/2368346202




          Command
Framework Framework
                      (cc) Crazy Diamond http://www.flickr.com/photos/48446424@N00/4505142495
Change
Recorder
Notify
                      (cc) shankar, shiv http://www.flickr.com/photos/14722496@N04/2368346202




          Command
Framework Framework
Change
Recorder
notifies
Observer               Observable
   —                       —
Adapter                 Notifier
           registers
5




Notification
Message from the Observable to the Observer
Add

      Unset                 Remove


              Notification
Set            Event            Add
                                Many
               Type
                            Remove
  Resolve
                             Many
                Remove
                Adapter
(cc) chubstock http://www.flickr.com/photos/21497715@N08/2079885002




Notifications
               Stop Delivering
{   For all model elements

     In Genmodel

     Set «Model / Suppress Notification» to false




{   For one model elements

     On EObject instance

     call #eSetDeliver(false)
EContent Adapter
Listener of Containment Tree
EContent Adapter
Listener of Containment Tree




                               eAdapters().add(EContentAdapter)
EContent Adapter
Listener of Containment Tree




                               eAdapters().add(EContentAdapter)
3... 2... 1... Action!
Code available

https://gist.github.com/mbarbero/18e16fe13da40ba825ce



https://gist.github.com/mbarbero/e8aa2c0754dccdd45b
Notify Command
Framework Framework
                      (cc) Crazy Diamond http://www.flickr.com/photos/48446424@N00/4505142495
Change
Recorder
Wh
                                                    at i
                                                        sa
(cc) jDevaun http://www.flickr.com/photos/34316967@N04/3838807132
                                                                   ?
Executability
Executability


           Undoability
Executability


           Undoability


                         Redo
Result
Result


         Aected Objects
Result


         Aected Objects


              Label / Description
Set


 Copy                 Add

           Generic
          Commands
Replace              Remove


            Move
Create
                 Child


Drag & Drop                  Delete

               High-level
              Commands
Paste from                   Cut To
Clipboard                   Clipboard

                Copy to
               Clipboard
(c) Simon Cox, Sept 2012
Command
 Stack




          (c) Simon Cox, Sept 2012
3... 2... 1... Action!
Code available


https://gist.github.com/mbarbero/77c81a93b5f63c441207
Notify Command     Change
Framework Framework   Recorder
Change Model
Bird view
                                  ChangeDescription

                                  apply()
                                  applyAndReverse()




                         objectChanges [*]
                                                       key
                                     Map<EObject,            EObject
                                      Changes>               (from ecore)

                                                                      referenceValue


                                   value [*]
                        feature
   EStructuralFeature               FeatureChange
       (from ecore)
                                  dataValue : String
Change Recorder
Listener of Containment Tree

                               Change
                               Recorder
Change Recorder
Listener of Containment Tree

                                   Change
                                   Recorder

                       Listen to
Change Recorder
Listener of Containment Tree

                                   Change
                                   Recorder

                       Listen to              Creates




                                                        Change model
Change Command




(cc) fdecomite http://www.flickr.com/photos/21649179@N00/6478685035
Change Command

Execute
Change Command

   Execute




Change recorder
Change Command

   Execute        Undo   Redo




Change recorder
Change Command

   Execute        Undo          Redo




Change recorder     applyAndReverse
3... 2... 1... Action!
Code available


https://gist.github.com/mbarbero/6e6b88ee61ce7e2e57
(cc) debaird™ http://www.flickr.com/photos/48889107219@N01/239460739




 What you should remember
What you should remember
Adapter +
   ChangeModel
        =
  ChangeRecorder




What you should remember
Adapter +       Command +
   ChangeModel     ChangeRecorder
        =                =
  ChangeRecorder   ChangeCommand




What you should remember
Adapter +           Command +
   ChangeModel         ChangeRecorder

  ChangeRecorder   +   ChangeCommand


     Steroïds for Your App



What you should remember

EMF.Edit the Force Unleashed!