SlideShare una empresa de Scribd logo
1 de 14
Using Adapters to Handle Menus and Handlers in
Large Scale Applications



How do you effectively control commands, menus and handlers in a large pluggable
application to get a consistent use of the commands across the complete application?
This is definitely one of the areas where the Eclipse IDE is not a good sample application.
Just notice how all team providers add commands with the same text and function and
how multiple identical menu items some times show up...
Here the Adapter framework of Eclipse can be a big help if used properly.
While the Adapter framework arguably is one of the more difficult to understand and use
properly, the is also a framework that will solve many of the problems you might face is
larger non-trivial applications. Especially when used in conjunction with the menus
extension point and handlers. This presentation will show how to use the adapter
framework of the Eclipse framework with special emphasis on the menus and handlers.




Redistribution and other use of this material requires written permission from The RCP Company.

L0001 - 2010-11-27
The Agenda




The problem with commands and
handlers in large Eclipse based
applications




The Adapter framework of Eclipse




How to use the Adapter framework to
solve the problem with focus on the
actual code used




2
                                      L0001 - 2010-11-27
Complexity of Handler Expressions




Expressions for handlers (activeWhen and
enabledWhen) are often difficult to get
correct

If the expression depends on internal
state a property tester is needed
     The flow is more complicated
     The tests get more involved




3
                                           L0001 - 2010-11-27
The Problems




If we want to implement a specific
command for a large number of different
domain objects, then a large portion of
the code for the handles will be identical

E.g. handlers for “cut”, “print”, connect”,
etc




4
                                              L0001 - 2010-11-27
The Problems




Multiple - basically identical - commands

In large enterprise applications, this is
almost impossible to manage

How about key bindings?




5
                                            L0001 - 2010-11-27
The Idea




Given
     a specific object in the domain
      model (here a customer Benjamin”)
     a command, we like to perform on
      the object (here “Show Segment”)

...use the Adapter Manager of Eclipse to
get the type specific behavior for the
object

If no specific behavior can be found, the
command is not active

Use the same method in the generic
handler




6
                                            L0001 - 2010-11-27
Why Adapters?
                                         UI Concerns
                                                         Label Provider
     Domain Model

                Contact
                                                              Tree Providers
                                         Content Providers
      Segment
                      Customer




    Domain Model
                    Contract           Functionality
                                                                Edit
                                            Print
                               Offer
       Price Item
                                                               Call

                                                Save




7
                                                                               L0001 - 2010-11-27
Why Adapters?
                                                       UI Concerns
                                                                       Label Provider
     Domain Model




                                       }
                Contact
                                                                            Tree Providers
                                                       Content Providers
      Segment
                      Customer




                                           Manager




    Domain Model
                    Contract                         Functionality
                                                                              Edit
                                                          Print
                               Offer
       Price Item
                                                                             Call

                                                              Save




8
                                                                                             L0001 - 2010-11-27
Adding Adapters


Implement the interface directly

Sub-class IAdaptable

Declare using org.eclipse.core.runtime.adapters

Register directly at run-time




    <extension point="org.eclipse.core.runtime.adapters">
       <factory
          adaptableType="com.rcpcompany.ex.adapterhandlers.model.Segment"
          class="com.rcpcompany.ex.adapterhandlers.adapters.SegmentAdapterFactory">
          <adapter type="com.rcpcompany.ex.adapterhandlers.functionality.IDoShowSegment" />
       </factory>
    </extension>




9
                                                                                              L0001 - 2010-11-27
The Code




10
            L0001 - 2010-11-27
A Few Closing Remarks


 The way the adapt expression works, it is best to place the the adapter in
 the same plug-in as the domain model - see BugZilla #82973 for a long and
 complicated description for the background



 The adapt expression is going to be invoked often, so use stateless adapter
 object rather than stateful adapters to the same adapter object can be re-
 used



 Put the interfaces for the relevant functionality - e.g. IDoShowSegment - in a
 separate plug-in along with the declaration of the same commands




11
                                                                             L0001 - 2010-11-27
Summing Up


 All handlers will have almost identical




12
                                           L0001 - 2010-11-27
Resources


 This presentation is based on the same outline as the following blog entry
      http://blog.rcp-company.com/2010/02/using-adapters-in-handlers-to-
       control.html




13
                                                                          L0001 - 2010-11-27
About Me


 Tonny Madsen, Founder and Owner of The RCP Company
      20 years of experience in system development in major
       companies
      9 years of experience with Eclipse and Eclipse RCP

 Chairman of Eclipse.dk

 Extern Lecturer at IT-University on Model Driven Development and
 Domain Specific Languages

 Regular speaker at EclipseCon, Eclipse Summit Europe, Eclipse
 Summit India, etc

 Reached via
      tonny.madsen@rcp-company.com
      Phone: +45 70 22 25 92
      Twitter: tonnymadsen
      Blog: http://blog.rcp-company.com/
      LinkedIn: http://linkedin.com/in/tonnymadsen

14
                                                                    L0001 - 2010-11-27

Más contenido relacionado

Destacado

IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...Tonny Madsen
 
IDA - Eclipse Workshop I (In Danish)
IDA - Eclipse Workshop I (In Danish)IDA - Eclipse Workshop I (In Danish)
IDA - Eclipse Workshop I (In Danish)Tonny Madsen
 
EclipseCon '08 - BoF - Building a local Eclipse user group
EclipseCon '08 - BoF - Building a local Eclipse user groupEclipseCon '08 - BoF - Building a local Eclipse user group
EclipseCon '08 - BoF - Building a local Eclipse user groupTonny Madsen
 
L0036 - Creating Views and Editors
L0036 - Creating Views and EditorsL0036 - Creating Views and Editors
L0036 - Creating Views and EditorsTonny Madsen
 
TARGET Authoring Tools
TARGET Authoring ToolsTARGET Authoring Tools
TARGET Authoring Toolsgeorgo
 
PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?Tonny Madsen
 
L0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationL0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationTonny Madsen
 
Enfermedades Mentáis
Enfermedades MentáisEnfermedades Mentáis
Enfermedades MentáisGiselle Smith
 
ITU - MDD – Model-to-Model Transformations
ITU - MDD – Model-to-Model TransformationsITU - MDD – Model-to-Model Transformations
ITU - MDD – Model-to-Model TransformationsTonny Madsen
 
ITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsTonny Madsen
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012Olivier MJ Crépin-Leblond
 
IDA - Eclipse Workshop II (In Danish)
IDA - Eclipse Workshop II (In Danish)IDA - Eclipse Workshop II (In Danish)
IDA - Eclipse Workshop II (In Danish)Tonny Madsen
 
EclipseCon '08 - Lessons Learned from an Enterprise RCP Application
EclipseCon '08 - Lessons Learned from an Enterprise RCP ApplicationEclipseCon '08 - Lessons Learned from an Enterprise RCP Application
EclipseCon '08 - Lessons Learned from an Enterprise RCP ApplicationTonny Madsen
 
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...Tonny Madsen
 
javagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platformjavagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platformTonny Madsen
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insTonny Madsen
 

Destacado (20)

IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
 
IDA - Eclipse Workshop I (In Danish)
IDA - Eclipse Workshop I (In Danish)IDA - Eclipse Workshop I (In Danish)
IDA - Eclipse Workshop I (In Danish)
 
EclipseCon '08 - BoF - Building a local Eclipse user group
EclipseCon '08 - BoF - Building a local Eclipse user groupEclipseCon '08 - BoF - Building a local Eclipse user group
EclipseCon '08 - BoF - Building a local Eclipse user group
 
L0036 - Creating Views and Editors
L0036 - Creating Views and EditorsL0036 - Creating Views and Editors
L0036 - Creating Views and Editors
 
TARGET Authoring Tools
TARGET Authoring ToolsTARGET Authoring Tools
TARGET Authoring Tools
 
Battle
BattleBattle
Battle
 
PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?PROSA - Eclipse Is Just What?
PROSA - Eclipse Is Just What?
 
L0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationL0020 - The Basic RCP Application
L0020 - The Basic RCP Application
 
Enfermedades Mentáis
Enfermedades MentáisEnfermedades Mentáis
Enfermedades Mentáis
 
ITU - MDD – Model-to-Model Transformations
ITU - MDD – Model-to-Model TransformationsITU - MDD – Model-to-Model Transformations
ITU - MDD – Model-to-Model Transformations
 
ITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and Grammars
 
Amma Rap
Amma RapAmma Rap
Amma Rap
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012
 
IDA - Eclipse Workshop II (In Danish)
IDA - Eclipse Workshop II (In Danish)IDA - Eclipse Workshop II (In Danish)
IDA - Eclipse Workshop II (In Danish)
 
EclipseCon '08 - Lessons Learned from an Enterprise RCP Application
EclipseCon '08 - Lessons Learned from an Enterprise RCP ApplicationEclipseCon '08 - Lessons Learned from an Enterprise RCP Application
EclipseCon '08 - Lessons Learned from an Enterprise RCP Application
 
ITU - MDD - XText
ITU - MDD - XTextITU - MDD - XText
ITU - MDD - XText
 
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
 
javagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platformjavagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platform
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
 
FTC Red Flag Rule
FTC  Red Flag RuleFTC  Red Flag Rule
FTC Red Flag Rule
 

Similar a EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale Applications

Framework Engineering
Framework EngineeringFramework Engineering
Framework EngineeringYoungSu Son
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"GlobalLogic Ukraine
 
Sa 006 modifiability
Sa 006 modifiabilitySa 006 modifiability
Sa 006 modifiabilityFrank Gielen
 
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...Jennifer Stevenson
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Marco Brambilla
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Refreshing Domain Driven Design
Refreshing Domain Driven DesignRefreshing Domain Driven Design
Refreshing Domain Driven DesignAndré Borgonovo
 
M3 Modernization Case Study
M3 Modernization Case StudyM3 Modernization Case Study
M3 Modernization Case StudyADC Austin Tech
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessDavalen LLC
 
IBM Rational Software Conference 2009: Requirements Definition & Management T...
IBM Rational Software Conference 2009: Requirements Definition & Management T...IBM Rational Software Conference 2009: Requirements Definition & Management T...
IBM Rational Software Conference 2009: Requirements Definition & Management T...Kathy (Kat) Mandelstein
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...EclipseDayParis
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpromanojdhir
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpromanojdhir
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
Multi-Dimensional Context-Aware Adaptation of Service Front-ends
Multi-Dimensional Context-Aware Adaptation of Service Front-endsMulti-Dimensional Context-Aware Adaptation of Service Front-ends
Multi-Dimensional Context-Aware Adaptation of Service Front-endsJean Vanderdonckt
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 

Similar a EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale Applications (20)

Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
 
Unit 04: From Requirements to the UX Model
Unit 04: From Requirements to the UX ModelUnit 04: From Requirements to the UX Model
Unit 04: From Requirements to the UX Model
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Sa 006 modifiability
Sa 006 modifiabilitySa 006 modifiability
Sa 006 modifiability
 
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...
Grow your Business: Webcast Wednesday Presentation Series Microsoft Partner O...
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Refreshing Domain Driven Design
Refreshing Domain Driven DesignRefreshing Domain Driven Design
Refreshing Domain Driven Design
 
M3 Modernization Case Study
M3 Modernization Case StudyM3 Modernization Case Study
M3 Modernization Case Study
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or less
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
IBM Rational Software Conference 2009: Requirements Definition & Management T...
IBM Rational Software Conference 2009: Requirements Definition & Management T...IBM Rational Software Conference 2009: Requirements Definition & Management T...
IBM Rational Software Conference 2009: Requirements Definition & Management T...
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpro
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpro
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
Multi-Dimensional Context-Aware Adaptation of Service Front-ends
Multi-Dimensional Context-Aware Adaptation of Service Front-endsMulti-Dimensional Context-Aware Adaptation of Service Front-ends
Multi-Dimensional Context-Aware Adaptation of Service Front-ends
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 

Más de Tonny Madsen

L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsTonny Madsen
 
L0037 - Basic Eclipse Configuration
L0037 - Basic Eclipse ConfigurationL0037 - Basic Eclipse Configuration
L0037 - Basic Eclipse ConfigurationTonny Madsen
 
L0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget ToolkitL0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget ToolkitTonny Madsen
 
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inTonny Madsen
 
L0001 - The Terminology of the Eclipse Platform
L0001 - The Terminology of the Eclipse PlatformL0001 - The Terminology of the Eclipse Platform
L0001 - The Terminology of the Eclipse PlatformTonny Madsen
 
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureEclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureTonny Madsen
 
Eclipse Demo Camp 2010 - UI Bindings - An Introduction
Eclipse Demo Camp 2010 - UI Bindings - An IntroductionEclipse Demo Camp 2010 - UI Bindings - An Introduction
Eclipse Demo Camp 2010 - UI Bindings - An IntroductionTonny Madsen
 
ITU - MDD - Eclipse Plug-ins
ITU - MDD - Eclipse Plug-insITU - MDD - Eclipse Plug-ins
ITU - MDD - Eclipse Plug-insTonny Madsen
 
eclipse.dk - Eclipse RCP Under the Hood
eclipse.dk - Eclipse RCP Under the Hoodeclipse.dk - Eclipse RCP Under the Hood
eclipse.dk - Eclipse RCP Under the HoodTonny Madsen
 
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...Tonny Madsen
 
ITU - MDD – Modeling Techniques
ITU - MDD – Modeling TechniquesITU - MDD – Modeling Techniques
ITU - MDD – Modeling TechniquesTonny Madsen
 
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejenIDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejenTonny Madsen
 
notesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Toolsnotesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling ToolsTonny Madsen
 
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application Platform
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application PlatformEclipse Banking Day in Copenhagen - Eclipse RCP as an Application Platform
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application PlatformTonny Madsen
 

Más de Tonny Madsen (16)

L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard Views
 
L0037 - Basic Eclipse Configuration
L0037 - Basic Eclipse ConfigurationL0037 - Basic Eclipse Configuration
L0037 - Basic Eclipse Configuration
 
L0033 - JFace
L0033 - JFaceL0033 - JFace
L0033 - JFace
 
L0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget ToolkitL0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget Toolkit
 
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
 
L0001 - The Terminology of the Eclipse Platform
L0001 - The Terminology of the Eclipse PlatformL0001 - The Terminology of the Eclipse Platform
L0001 - The Terminology of the Eclipse Platform
 
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureEclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
 
Eclipse Demo Camp 2010 - UI Bindings - An Introduction
Eclipse Demo Camp 2010 - UI Bindings - An IntroductionEclipse Demo Camp 2010 - UI Bindings - An Introduction
Eclipse Demo Camp 2010 - UI Bindings - An Introduction
 
ITU - MDD - EMF
ITU - MDD - EMFITU - MDD - EMF
ITU - MDD - EMF
 
ITU - MDD - Eclipse Plug-ins
ITU - MDD - Eclipse Plug-insITU - MDD - Eclipse Plug-ins
ITU - MDD - Eclipse Plug-ins
 
eclipse.dk - Eclipse RCP Under the Hood
eclipse.dk - Eclipse RCP Under the Hoodeclipse.dk - Eclipse RCP Under the Hood
eclipse.dk - Eclipse RCP Under the Hood
 
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
 
ITU - MDD – Modeling Techniques
ITU - MDD – Modeling TechniquesITU - MDD – Modeling Techniques
ITU - MDD – Modeling Techniques
 
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejenIDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen
 
notesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Toolsnotesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Tools
 
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application Platform
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application PlatformEclipse Banking Day in Copenhagen - Eclipse RCP as an Application Platform
Eclipse Banking Day in Copenhagen - Eclipse RCP as an Application Platform
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale Applications

  • 1. Using Adapters to Handle Menus and Handlers in Large Scale Applications How do you effectively control commands, menus and handlers in a large pluggable application to get a consistent use of the commands across the complete application? This is definitely one of the areas where the Eclipse IDE is not a good sample application. Just notice how all team providers add commands with the same text and function and how multiple identical menu items some times show up... Here the Adapter framework of Eclipse can be a big help if used properly. While the Adapter framework arguably is one of the more difficult to understand and use properly, the is also a framework that will solve many of the problems you might face is larger non-trivial applications. Especially when used in conjunction with the menus extension point and handlers. This presentation will show how to use the adapter framework of the Eclipse framework with special emphasis on the menus and handlers. Redistribution and other use of this material requires written permission from The RCP Company. L0001 - 2010-11-27
  • 2. The Agenda The problem with commands and handlers in large Eclipse based applications The Adapter framework of Eclipse How to use the Adapter framework to solve the problem with focus on the actual code used 2 L0001 - 2010-11-27
  • 3. Complexity of Handler Expressions Expressions for handlers (activeWhen and enabledWhen) are often difficult to get correct If the expression depends on internal state a property tester is needed  The flow is more complicated  The tests get more involved 3 L0001 - 2010-11-27
  • 4. The Problems If we want to implement a specific command for a large number of different domain objects, then a large portion of the code for the handles will be identical E.g. handlers for “cut”, “print”, connect”, etc 4 L0001 - 2010-11-27
  • 5. The Problems Multiple - basically identical - commands In large enterprise applications, this is almost impossible to manage How about key bindings? 5 L0001 - 2010-11-27
  • 6. The Idea Given  a specific object in the domain model (here a customer Benjamin”)  a command, we like to perform on the object (here “Show Segment”) ...use the Adapter Manager of Eclipse to get the type specific behavior for the object If no specific behavior can be found, the command is not active Use the same method in the generic handler 6 L0001 - 2010-11-27
  • 7. Why Adapters? UI Concerns Label Provider Domain Model Contact Tree Providers Content Providers Segment Customer Domain Model Contract Functionality Edit Print Offer Price Item Call Save 7 L0001 - 2010-11-27
  • 8. Why Adapters? UI Concerns Label Provider Domain Model } Contact Tree Providers Content Providers Segment Customer Manager Domain Model Contract Functionality Edit Print Offer Price Item Call Save 8 L0001 - 2010-11-27
  • 9. Adding Adapters Implement the interface directly Sub-class IAdaptable Declare using org.eclipse.core.runtime.adapters Register directly at run-time <extension point="org.eclipse.core.runtime.adapters"> <factory adaptableType="com.rcpcompany.ex.adapterhandlers.model.Segment" class="com.rcpcompany.ex.adapterhandlers.adapters.SegmentAdapterFactory"> <adapter type="com.rcpcompany.ex.adapterhandlers.functionality.IDoShowSegment" /> </factory> </extension> 9 L0001 - 2010-11-27
  • 10. The Code 10 L0001 - 2010-11-27
  • 11. A Few Closing Remarks The way the adapt expression works, it is best to place the the adapter in the same plug-in as the domain model - see BugZilla #82973 for a long and complicated description for the background The adapt expression is going to be invoked often, so use stateless adapter object rather than stateful adapters to the same adapter object can be re- used Put the interfaces for the relevant functionality - e.g. IDoShowSegment - in a separate plug-in along with the declaration of the same commands 11 L0001 - 2010-11-27
  • 12. Summing Up All handlers will have almost identical 12 L0001 - 2010-11-27
  • 13. Resources This presentation is based on the same outline as the following blog entry  http://blog.rcp-company.com/2010/02/using-adapters-in-handlers-to- control.html 13 L0001 - 2010-11-27
  • 14. About Me Tonny Madsen, Founder and Owner of The RCP Company  20 years of experience in system development in major companies  9 years of experience with Eclipse and Eclipse RCP Chairman of Eclipse.dk Extern Lecturer at IT-University on Model Driven Development and Domain Specific Languages Regular speaker at EclipseCon, Eclipse Summit Europe, Eclipse Summit India, etc Reached via  tonny.madsen@rcp-company.com  Phone: +45 70 22 25 92  Twitter: tonnymadsen  Blog: http://blog.rcp-company.com/  LinkedIn: http://linkedin.com/in/tonnymadsen 14 L0001 - 2010-11-27

Notas del editor

  1. \n
  2. \n
  3. \n
  4. Before &amp;#x201C;checkEnabled&amp;#x201D; was implemented in Eclipse (3.3 I believe), you also had to specify a visibleWhen expression which was a or&amp;#x2019;ed together version of the activewhen expression for all relevant handlers. A difficult position\n
  5. This often happens because the involved teams cannot\n
  6. \n
  7. This can entail all sorts of problems, where the top two are:\n- conflicts between the different involved interface - what is getNsme()\n- often you don&amp;#x2019;t want have you UI concerns and application functionality in your domain model - separation of concerns\n\n
  8. Here we solve the problems by having a manager that can return the correct class given one of the domain objects and a wanted functionality\n\nThe participants:\n- The Adabtable Type: the types that can be adapted\n- The Adapter: the type that can be adapted to\n- Factory:entity that can adapt a specific adaptable type to a number of adapters\n- Manager: manager of factories\n\n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n