DCI                                Data, Context and                                   Interaction                        ...
About the speaker   DCI                                          2Wednesday, April 20, 2011                           2
About the speaker       •       Senior Software Architect, Mentor, Technical Writer       •       Fourteen years of Java e...
Agenda   DCI                               3Wednesday, April 20, 2011                3
Agenda       •       Two real world examples   DCI                                      3Wednesday, April 20, 2011        ...
Agenda       •       Two real world examples       •       DCI - Basic concepts   DCI                                     ...
Agenda       •       Two real world examples       •       DCI - Basic concepts       •       DCI - How to implement?   DC...
Agenda       •       Two real world examples       •       DCI - Basic concepts       •       DCI - How to implement?     ...
Agenda       •       Two real world examples       •       DCI - Basic concepts       •       DCI - How to implement?     ...
Two real world                              examplesWednesday, April 20, 2011                    4
Shameless Plug   DCI                                       5Wednesday, April 20, 2011                        5
Shameless Plug       •       Exercises of Design - my design book...   DCI                                                ...
Shameless Plug       •       Exercises of Design - my design book...             •       Just started!   DCI              ...
Shameless Plug       •       Exercises of Design - my design book...             •       Just started!       •       http:...
The Observation API       •       A core component of blueBill Mobile       •       An application about recording bird ob...
The Observation API       •       A core component of blueBill Mobile       •       An application about recording bird ob...
The Observation API       •       A core component of blueBill Mobile       •       An application about recording bird ob...
DCI                      7Wednesday, April 20, 2011       7
The Taxonomy API       •       Models the taxonomy of a philogenetic tree             •       The standard way of biology ...
DCI                      9Wednesday, April 20, 2011       9
DCI - Basic ConceptsWednesday, April 20, 2011                          10
Data, Context and Interaction   DCI                                                 11Wednesday, April 20, 2011           ...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug   DCI                          ...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug             •       The formali...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug             •       The formali...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug             •       The formali...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug             •       The formali...
Data, Context and Interaction       •       OOD best practice invented by Trygve Reenskaug             •       The formali...
DCI - aims   DCI                                   12Wednesday, April 20, 2011                     12
DCI - aims       •       Improve readability of a OO system   DCI                                              12Wednesday...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status   DCI   ...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status         ...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status         ...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status         ...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status         ...
DCI - aims       •       Improve readability of a OO system       •       Give system behaviour first-class status         ...
DCI - Data   DCI                                   13Wednesday, April 20, 2011                     13
DCI - Data       •       What the system is   DCI                                           13Wednesday, April 20, 2011   ...
DCI - Data       •       What the system is       •       Relatively static with relations   DCI                          ...
DCI - Data       •       What the system is       •       Relatively static with relations       •       Domain structure ...
DCI - Data       •       What the system is       •       Relatively static with relations       •       Domain structure ...
DCI - Data       •       What the system is       •       Relatively static with relations       •       Domain structure ...
DCI - Data       •       What the system is       •       Relatively static with relations       •       Domain structure ...
DCI - Data       •       What the system is       •       Relatively static with relations       •       Domain structure ...
DCI - Context (and Roles)   DCI                                                  14Wednesday, April 20, 2011              ...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm   DCI                ...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
DCI - Context (and Roles)       •       Associated to a use case, user story, scenario, or algorithm       •       Identifi...
Quick terminology note   DCI                                               15Wednesday, April 20, 2011                    ...
Quick terminology note       •       Methodless role: abstract role   DCI                                               15...
Quick terminology note       •       Methodless role: abstract role             •       Interface, abstract class   DCI   ...
Quick terminology note       •       Methodless role: abstract role             •       Interface, abstract class       • ...
Quick terminology note       •       Methodless role: abstract role             •       Interface, abstract class       • ...
DCI - Interaction   DCI                                          16Wednesday, April 20, 2011                            16
DCI - Interaction       •       What the system does   DCI                                          16Wednesday, April 20,...
DCI - Interaction       •       What the system does       •       Occurs among roles, which act as adapters to objects   ...
DCI - Interaction       •       What the system does       •       Occurs among roles, which act as adapters to objects   ...
DCI - Interaction       •       What the system does       •       Occurs among roles, which act as adapters to objects   ...
DCI - Interaction       •       What the system does       •       Occurs among roles, which act as adapters to objects   ...
DCI - Interaction       •       What the system does       •       Occurs among roles, which act as adapters to objects   ...
DCI - Execution Model   DCI                                              17Wednesday, April 20, 2011                      ...
DCI - Execution Model       •       The Context finds object participants   DCI                                            ...
DCI - Execution Model       •       The Context finds object participants       •       Then, it assigns (injects?) roles t...
DCI - Execution Model       •       The Context finds object participants       •       Then, it assigns (injects?) roles t...
DCI - Execution Model       •       The Context finds object participants       •       Then, it assigns (injects?) roles t...
DCI - Execution Model       •       The Context finds object participants       •       Then, it assigns (injects?) roles t...
DCI - Execution Model       •       The Context finds object participants       •       Then, it assigns (injects?) roles t...
DCI - How to                             implement?Wednesday, April 20, 2011                  18
Some design issues   DCI                                           19Wednesday, April 20, 2011                            ...
Some design issues       •       Static vs dynamic   DCI                                           19Wednesday, April 20, ...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins   DCI                                    ...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Some design issues       •       Static vs dynamic       •       Traits, Mix-ins       •       AOP, annotations (e.g. Qi4J...
Designing with DCI   DCI                                           20Wednesday, April 20, 2011                            ...
Designing with DCI       •       First, acknowledge that DCI is a best practice   DCI                                     ...
Designing with DCI       •       First, acknowledge that DCI is a best practice             •       Some languages can fit ...
Designing with DCI       •       First, acknowledge that DCI is a best practice             •       Some languages can fit ...
Designing with DCI       •       First, acknowledge that DCI is a best practice             •       Some languages can fit ...
Some UI-oriented                               examplesWednesday, April 20, 2011                      21
NodesExample 1       •       Static role implementation       •       Introduce some generic, (G)UI oriented roles       •...
NodesExample 2       •       Dynamically replacing roles with decorators   DCI                                            ...
NodesExample 4       •       Adding contextual Actions and ToolTips   DCI                                                 ...
NodesExample 5       •       Removing UI dependencied   DCI                                       25Wednesday, April 20, 2...
NodesExample 6       •       Injecting roles from the Context   DCI                                            26Wednesday...
NodesExample 7       •       Injecting Roles in function of the Context   DCI                                             ...
Abstracting and                              sweeteningWednesday, April 20, 2011                     28
Abstracting and sweetening       •       Would be nice to be technology independent       •       Would be nice to have so...
as()   DCI                             30Wednesday, April 20, 2011               30
as()       •       From Role role = object.getLookup().lookup(Role.class) ...   DCI                                       ...
as()       •       From Role role = object.getLookup().lookup(Role.class) ...       •       ... to Role role = object.as(R...
as()       •       From Role role = object.getLookup().lookup(Role.class) ...       •       ... to Role role = object.as(R...
as()       •       From Role role = object.getLookup().lookup(Role.class) ...       •       ... to Role role = object.as(R...
as()       •       From Role role = object.getLookup().lookup(Role.class) ...       •       ... to Role role = object.as(R...
Q &A       •       Question Time   DCI                                31Wednesday, April 20, 2011                  31
Upcoming SlideShare
Loading in...5
×

DCI - Data, Context and Interaction @ Jug Genova April 2011

1,768

Published on

My personal take on the Data, Context and Interaction best practice.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,768
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "DCI - Data, Context and Interaction @ Jug Genova April 2011"

  1. 1. DCI Data, Context and Interaction Fabrizio Giudici, Senior Java Architect Tidalwave s.a.s - fabrizio.giudici@tidalwave.itWednesday, April 20, 2011 1
  2. 2. About the speaker DCI 2Wednesday, April 20, 2011 2
  3. 3. About the speaker • Senior Software Architect, Mentor, Technical Writer • Fourteen years of Java experience (JSE, JEE, JME, etc...) • Sun partner since 1998, Oracle consultant since 2010 • Author of a number of open source projects • Speaker at JavaOne, Devoxx, Jazoon, JAX and other events • Member of the NetBeans Dream Team • Co-leader of JUG Milano • Java.Net blogger at http://www.java.net/blogs/fabriziogiudici DCI 2Wednesday, April 20, 2011 2
  4. 4. Agenda DCI 3Wednesday, April 20, 2011 3
  5. 5. Agenda • Two real world examples DCI 3Wednesday, April 20, 2011 3
  6. 6. Agenda • Two real world examples • DCI - Basic concepts DCI 3Wednesday, April 20, 2011 3
  7. 7. Agenda • Two real world examples • DCI - Basic concepts • DCI - How to implement? DCI 3Wednesday, April 20, 2011 3
  8. 8. Agenda • Two real world examples • DCI - Basic concepts • DCI - How to implement? • Some simple examples DCI 3Wednesday, April 20, 2011 3
  9. 9. Agenda • Two real world examples • DCI - Basic concepts • DCI - How to implement? • Some simple examples • Abstracting and sweetening DCI 3Wednesday, April 20, 2011 3
  10. 10. Two real world examplesWednesday, April 20, 2011 4
  11. 11. Shameless Plug DCI 5Wednesday, April 20, 2011 5
  12. 12. Shameless Plug • Exercises of Design - my design book... DCI 5Wednesday, April 20, 2011 5
  13. 13. Shameless Plug • Exercises of Design - my design book... • Just started! DCI 5Wednesday, April 20, 2011 5
  14. 14. Shameless Plug • Exercises of Design - my design book... • Just started! • http://exercisesofdesign.java.net DCI 5Wednesday, April 20, 2011 5
  15. 15. The Observation API • A core component of blueBill Mobile • An application about recording bird observations • Designed with a high degree of abstraction DCI 6Wednesday, April 20, 2011 6
  16. 16. The Observation API • A core component of blueBill Mobile • An application about recording bird observations • Designed with a high degree of abstraction DCI 6Wednesday, April 20, 2011 6
  17. 17. The Observation API • A core component of blueBill Mobile • An application about recording bird observations • Designed with a high degree of abstraction DCI 6Wednesday, April 20, 2011 6
  18. 18. DCI 7Wednesday, April 20, 2011 7
  19. 19. The Taxonomy API • Models the taxonomy of a philogenetic tree • The standard way of biology for representing living beings species DCI 8Wednesday, April 20, 2011 8
  20. 20. DCI 9Wednesday, April 20, 2011 9
  21. 21. DCI - Basic ConceptsWednesday, April 20, 2011 10
  22. 22. Data, Context and Interaction DCI 11Wednesday, April 20, 2011 11
  23. 23. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug DCI 11Wednesday, April 20, 2011 11
  24. 24. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug • The formalizer of MVC DCI 11Wednesday, April 20, 2011 11
  25. 25. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug • The formalizer of MVC • Seen as an evolution of MVC DCI 11Wednesday, April 20, 2011 11
  26. 26. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug • The formalizer of MVC • Seen as an evolution of MVC • But it doesn’t replace it DCI 11Wednesday, April 20, 2011 11
  27. 27. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug • The formalizer of MVC • Seen as an evolution of MVC • But it doesn’t replace it • It rather broadens the analysis scope DCI 11Wednesday, April 20, 2011 11
  28. 28. Data, Context and Interaction • OOD best practice invented by Trygve Reenskaug • The formalizer of MVC • Seen as an evolution of MVC • But it doesn’t replace it • It rather broadens the analysis scope • http://www.artima.com/articles/dci_vision.html DCI 11Wednesday, April 20, 2011 11
  29. 29. DCI - aims DCI 12Wednesday, April 20, 2011 12
  30. 30. DCI - aims • Improve readability of a OO system DCI 12Wednesday, April 20, 2011 12
  31. 31. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status DCI 12Wednesday, April 20, 2011 12
  32. 32. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status • Recover readability of system properties on the whole DCI 12Wednesday, April 20, 2011 12
  33. 33. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status • Recover readability of system properties on the whole • Separate responsibilities for behaviour and domain DCI 12Wednesday, April 20, 2011 12
  34. 34. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status • Recover readability of system properties on the whole • Separate responsibilities for behaviour and domain • Behaviour: what the system does DCI 12Wednesday, April 20, 2011 12
  35. 35. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status • Recover readability of system properties on the whole • Separate responsibilities for behaviour and domain • Behaviour: what the system does • Domain: what the system is DCI 12Wednesday, April 20, 2011 12
  36. 36. DCI - aims • Improve readability of a OO system • Give system behaviour first-class status • Recover readability of system properties on the whole • Separate responsibilities for behaviour and domain • Behaviour: what the system does • Domain: what the system is • Be close to people’s mental model DCI 12Wednesday, April 20, 2011 12
  37. 37. DCI - Data DCI 13Wednesday, April 20, 2011 13
  38. 38. DCI - Data • What the system is DCI 13Wednesday, April 20, 2011 13
  39. 39. DCI - Data • What the system is • Relatively static with relations DCI 13Wednesday, April 20, 2011 13
  40. 40. DCI - Data • What the system is • Relatively static with relations • Domain structure implemented with “conventional” classes DCI 13Wednesday, April 20, 2011 13
  41. 41. DCI - Data • What the system is • Relatively static with relations • Domain structure implemented with “conventional” classes • Typically it includes persistence DCI 13Wednesday, April 20, 2011 13
  42. 42. DCI - Data • What the system is • Relatively static with relations • Domain structure implemented with “conventional” classes • Typically it includes persistence • Comes from the mental model of system stakeholders DCI 13Wednesday, April 20, 2011 13
  43. 43. DCI - Data • What the system is • Relatively static with relations • Domain structure implemented with “conventional” classes • Typically it includes persistence • Comes from the mental model of system stakeholders • Close to the “model” in MVC DCI 13Wednesday, April 20, 2011 13
  44. 44. DCI - Data • What the system is • Relatively static with relations • Domain structure implemented with “conventional” classes • Typically it includes persistence • Comes from the mental model of system stakeholders • Close to the “model” in MVC • Example: BankAccount with increase(), decrease(); no deposit() DCI 13Wednesday, April 20, 2011 13
  45. 45. DCI - Context (and Roles) DCI 14Wednesday, April 20, 2011 14
  46. 46. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm DCI 14Wednesday, April 20, 2011 14
  47. 47. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario DCI 14Wednesday, April 20, 2011 14
  48. 48. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario • Assign to each object one or more stateless roles DCI 14Wednesday, April 20, 2011 14
  49. 49. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario • Assign to each object one or more stateless roles • Objects can have multiple roles at the same time DCI 14Wednesday, April 20, 2011 14
  50. 50. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario • Assign to each object one or more stateless roles • Objects can have multiple roles at the same time • Decompose the use case (etc...) into roles, not objects DCI 14Wednesday, April 20, 2011 14
  51. 51. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario • Assign to each object one or more stateless roles • Objects can have multiple roles at the same time • Decompose the use case (etc...) into roles, not objects • Contrast this with polymorphism and classic OO decomposition DCI 14Wednesday, April 20, 2011 14
  52. 52. DCI - Context (and Roles) • Associated to a use case, user story, scenario, or algorithm • Identifies objects participating in a scenario • Assign to each object one or more stateless roles • Objects can have multiple roles at the same time • Decompose the use case (etc...) into roles, not objects • Contrast this with polymorphism and classic OO decomposition • Example: MoneyTransfer with SrcAccount and DestAccount DCI 14Wednesday, April 20, 2011 14
  53. 53. Quick terminology note DCI 15Wednesday, April 20, 2011 15
  54. 54. Quick terminology note • Methodless role: abstract role DCI 15Wednesday, April 20, 2011 15
  55. 55. Quick terminology note • Methodless role: abstract role • Interface, abstract class DCI 15Wednesday, April 20, 2011 15
  56. 56. Quick terminology note • Methodless role: abstract role • Interface, abstract class • Methodful role: concrete role DCI 15Wednesday, April 20, 2011 15
  57. 57. Quick terminology note • Methodless role: abstract role • Interface, abstract class • Methodful role: concrete role • Regular class DCI 15Wednesday, April 20, 2011 15
  58. 58. DCI - Interaction DCI 16Wednesday, April 20, 2011 16
  59. 59. DCI - Interaction • What the system does DCI 16Wednesday, April 20, 2011 16
  60. 60. DCI - Interaction • What the system does • Occurs among roles, which act as adapters to objects DCI 16Wednesday, April 20, 2011 16
  61. 61. DCI - Interaction • What the system does • Occurs among roles, which act as adapters to objects • Roles are bound in different ways for each context DCI 16Wednesday, April 20, 2011 16
  62. 62. DCI - Interaction • What the system does • Occurs among roles, which act as adapters to objects • Roles are bound in different ways for each context • Roles should be generic DCI 16Wednesday, April 20, 2011 16
  63. 63. DCI - Interaction • What the system does • Occurs among roles, which act as adapters to objects • Roles are bound in different ways for each context • Roles should be generic • Roles life cycle is likely to be bound to a given interaction DCI 16Wednesday, April 20, 2011 16
  64. 64. DCI - Interaction • What the system does • Occurs among roles, which act as adapters to objects • Roles are bound in different ways for each context • Roles should be generic • Roles life cycle is likely to be bound to a given interaction • Interaction should be explicit given role nature, rather than emergent as in (agile) OOD DCI 16Wednesday, April 20, 2011 16
  65. 65. DCI - Execution Model DCI 17Wednesday, April 20, 2011 17
  66. 66. DCI - Execution Model • The Context finds object participants DCI 17Wednesday, April 20, 2011 17
  67. 67. DCI - Execution Model • The Context finds object participants • Then, it assigns (injects?) roles to them DCI 17Wednesday, April 20, 2011 17
  68. 68. DCI - Execution Model • The Context finds object participants • Then, it assigns (injects?) roles to them • Roles find each other by type (methodless) DCI 17Wednesday, April 20, 2011 17
  69. 69. DCI - Execution Model • The Context finds object participants • Then, it assigns (injects?) roles to them • Roles find each other by type (methodless) • What about static languages and designs? DCI 17Wednesday, April 20, 2011 17
  70. 70. DCI - Execution Model • The Context finds object participants • Then, it assigns (injects?) roles to them • Roles find each other by type (methodless) • What about static languages and designs? • Then, it invokes a method on the first role DCI 17Wednesday, April 20, 2011 17
  71. 71. DCI - Execution Model • The Context finds object participants • Then, it assigns (injects?) roles to them • Roles find each other by type (methodless) • What about static languages and designs? • Then, it invokes a method on the first role • Interaction goes on among other roles DCI 17Wednesday, April 20, 2011 17
  72. 72. DCI - How to implement?Wednesday, April 20, 2011 18
  73. 73. Some design issues DCI 19Wednesday, April 20, 2011 19
  74. 74. Some design issues • Static vs dynamic DCI 19Wednesday, April 20, 2011 19
  75. 75. Some design issues • Static vs dynamic • Traits, Mix-ins DCI 19Wednesday, April 20, 2011 19
  76. 76. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) DCI 19Wednesday, April 20, 2011 19
  77. 77. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia DCI 19Wednesday, April 20, 2011 19
  78. 78. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia • Which is the identity of an object that becomes a cluster of roles DCI 19Wednesday, April 20, 2011 19
  79. 79. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia • Which is the identity of an object that becomes a cluster of roles • Partly solved by the clear separation object (stateful) / role (stateless) DCI 19Wednesday, April 20, 2011 19
  80. 80. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia • Which is the identity of an object that becomes a cluster of roles • Partly solved by the clear separation object (stateful) / role (stateless) • What about equals() / hashcode()? DCI 19Wednesday, April 20, 2011 19
  81. 81. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia • Which is the identity of an object that becomes a cluster of roles • Partly solved by the clear separation object (stateful) / role (stateless) • What about equals() / hashcode()? • Problem: anemic objects DCI 19Wednesday, April 20, 2011 19
  82. 82. Some design issues • Static vs dynamic • Traits, Mix-ins • AOP, annotations (e.g. Qi4J) • Problems: schizophrenia • Which is the identity of an object that becomes a cluster of roles • Partly solved by the clear separation object (stateful) / role (stateless) • What about equals() / hashcode()? • Problem: anemic objects • Really a problem in this perspective? DCI 19Wednesday, April 20, 2011 19
  83. 83. Designing with DCI DCI 20Wednesday, April 20, 2011 20
  84. 84. Designing with DCI • First, acknowledge that DCI is a best practice DCI 20Wednesday, April 20, 2011 20
  85. 85. Designing with DCI • First, acknowledge that DCI is a best practice • Some languages can fit better than others DCI 20Wednesday, April 20, 2011 20
  86. 86. Designing with DCI • First, acknowledge that DCI is a best practice • Some languages can fit better than others • Frameworks might help... but they force a new nature DCI 20Wednesday, April 20, 2011 20
  87. 87. Designing with DCI • First, acknowledge that DCI is a best practice • Some languages can fit better than others • Frameworks might help... but they force a new nature • My point: DCI must be addressed in design DCI 20Wednesday, April 20, 2011 20
  88. 88. Some UI-oriented examplesWednesday, April 20, 2011 21
  89. 89. NodesExample 1 • Static role implementation • Introduce some generic, (G)UI oriented roles • NetBeans Platform’s Lookup based implementation DCI 22Wednesday, April 20, 2011 22
  90. 90. NodesExample 2 • Dynamically replacing roles with decorators DCI 23Wednesday, April 20, 2011 23
  91. 91. NodesExample 4 • Adding contextual Actions and ToolTips DCI 24Wednesday, April 20, 2011 24
  92. 92. NodesExample 5 • Removing UI dependencied DCI 25Wednesday, April 20, 2011 25
  93. 93. NodesExample 6 • Injecting roles from the Context DCI 26Wednesday, April 20, 2011 26
  94. 94. NodesExample 7 • Injecting Roles in function of the Context DCI 27Wednesday, April 20, 2011 27
  95. 95. Abstracting and sweeteningWednesday, April 20, 2011 28
  96. 96. Abstracting and sweetening • Would be nice to be technology independent • Would be nice to have some syntactic sugar DCI 29Wednesday, April 20, 2011 29
  97. 97. as() DCI 30Wednesday, April 20, 2011 30
  98. 98. as() • From Role role = object.getLookup().lookup(Role.class) ... DCI 30Wednesday, April 20, 2011 30
  99. 99. as() • From Role role = object.getLookup().lookup(Role.class) ... • ... to Role role = object.as(Role); DCI 30Wednesday, April 20, 2011 30
  100. 100. as() • From Role role = object.getLookup().lookup(Role.class) ... • ... to Role role = object.as(Role); • As a wrapper around Lookup DCI 30Wednesday, April 20, 2011 30
  101. 101. as() • From Role role = object.getLookup().lookup(Role.class) ... • ... to Role role = object.as(Role); • As a wrapper around Lookup • With annotations and Lombok DCI 30Wednesday, April 20, 2011 30
  102. 102. as() • From Role role = object.getLookup().lookup(Role.class) ... • ... to Role role = object.as(Role); • As a wrapper around Lookup • @AsCapable With annotations and Lombok public class MyObject { @Role private Role1 r1 = new Role1(); @Role // lazy private Provider<Role> r2 = ...; DCI } 30Wednesday, April 20, 2011 30
  103. 103. Q &A • Question Time DCI 31Wednesday, April 20, 2011 31
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×