Understanding Framework Architecture using Eclipse

A
Eclipse as a framework of frameworks   (Please view in presentation mode for desired flow of information) Anshu Jain IBM Research - India [email_address] anshunjain {gmail, twitter, googlesites)
Introductions ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
Motivation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What are we doing today Building a VERY simple calculator
V1 -  Monolithic Class
addFunctions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],+ - * /
executeOperation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The only constant - Change 1. Add new features – New functions 2. Fix existing features – Divide by Zero
The only constant – Change..!! private void addFunctions(Composite functionComposite) { … … Button xpoweryButton =  new  Button(functionComposite, SWT. NONE ); xpoweryButton.addSelectionListener( new  ButtonSelectionListener( "+" )); xpoweryButton.setLayoutData(data); xpoweryButton.setText( "x^y" ); Button modButton =  new  Button(functionComposite, SWT. NONE ); addButton.addSelectionListener( new  ButtonSelectionListener( "Mod" )); modButton.setLayoutData(data); modButton.setText( "Mod" ); private   int  divide( int  a,  int  b) { if  (b == 0) { text .setText( "DivideBy0 Error!" ); return  -1; }  else  { if  (a % b == 0) { text .setText( "Not absolute" ); return  a % b; } return  a / b; } }
The only constant – Change..!! ,[object Object],[object Object],[object Object]
Changes cannot be avoided ,[object Object],[object Object],[object Object]
V2 Refactoring – Separation of concern
V2 Refactoring – Separation of Concern Encapsulation
Indirection vs. Separation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
V3 – Thought ful Refactoring We still need to reference each function in calculator Code of createButton is common
V4 - Thoughtful Inheritance
The only constant  - Change ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to enable dynamic functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where to look for Any folder in my working directory becomes a function
Where to look for Nah..!! Not any folder..!!
V5 - Identification
V5 -  Invocation and Interaction ,[object Object],[object Object]
V5 – Dynamic Runtime - Dynamic loading of this jar (Classloading) - Dynamic instantiation of this class(Reflection)
V6 - Dynamic Discovery and Loading public void load(Calculator_Original calculator, String installDirectory) throws InstantiationException, IllegalAccessException { try { String[] nameOfFunctions =  loadFunctionsFromDirectory(installDirectory); IFunction[] functions =  new   IFunction[nameOfFunctions. length ]; MyCustomClassLoader loader =  new  MyCustomClassLoader( installDirectory); for  (IFunction function : functions) { Class functionClass = loader.loadClass( "" ); function = (IFunction)  functionClass.newInstance(); function.setCalculator(calculator); } } catch (ClassNotFoundException e) { // Handle this } }
V7 – providing a service ,[object Object],[object Object],[object Object],[object Object],[object Object]
As if life wasn’t tough ,[object Object],[object Object],[object Object],[object Object],[object Object],Building a VERY simple calculator But we already had one…!! Long ago..!   Building a calculator framework So we can make as complex calculators as we want, very simply... without worrying about all housekeeping
Revisiting our framework Separation of Concern Componentization Abstraction/Interface Registration and Discovery Dynamic Loading
What is a framework ,[object Object]
What does a framework do ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Building another pluggable framework ,[object Object],[object Object],[object Object],[object Object],[object Object]
What does a framework do ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Eclipse does all the above for u ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Eclipse – framework for component model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Model - Identification - add.cff - add.jar - Component Identifier - Component runtime info
Component Model - Identification BUNDLES - Manifest.MF - <bundlename>.jar - Bundle ID - Runtime Info: Classpath - blah..blah..
Component Model – OSGI Bundles  ,[object Object]
Component Model – Other APIs Framework for observing other components and services Resource and class loading Dynamic management of dependencies Hooks to component lifecycle  Service oriented component management
Framework for discovery ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Framework for discovery Who wants to let others extend them?  Who wants to extend? Who is extending me? Configuration provided by the extenders Properties of extenders I am lazy to even load the runtime Dynamic management of extenders
Eclipse – framework for abstraction/interface ,[object Object],[object Object],[object Object],[object Object]
Eclipse – services for frameworks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Eclipse – framework of frameworks ,[object Object],[object Object],[object Object]
Closing thoughts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you
1 sur 45

Recommandé

The Naked Bundle - Symfony Live London 2014 par
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014Matthias Noback
4K vues110 diapositives
Metaprogramming JavaScript par
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScriptdanwrong
43.6K vues94 diapositives
Advanced JavaScript - Internship Presentation - Week6 par
Advanced JavaScript - Internship Presentation - Week6Advanced JavaScript - Internship Presentation - Week6
Advanced JavaScript - Internship Presentation - Week6Devang Garach
165 vues21 diapositives
Java concurrency model - The Future Task par
Java concurrency model - The Future TaskJava concurrency model - The Future Task
Java concurrency model - The Future TaskSomenath Mukhopadhyay
426 vues7 diapositives
How Symfony Changed My Life par
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My LifeMatthias Noback
2.4K vues66 diapositives
How AngularJS Embraced Traditional Design Patterns par
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsRan Mizrahi
12.4K vues27 diapositives

Contenu connexe

Tendances

Effective JavaFX architecture with FxObjects par
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsSrikanth Shenoy
2K vues28 diapositives
Paris Web - Javascript as a programming language par
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
11.5K vues190 diapositives
Tech friday 22.01.2016 par
Tech friday 22.01.2016Tech friday 22.01.2016
Tech friday 22.01.2016Poutapilvi Web Design
496 vues25 diapositives
Node.JS error handling best practices par
Node.JS error handling best practicesNode.JS error handling best practices
Node.JS error handling best practicesYoni Goldberg
13.7K vues66 diapositives
Intro to JavaScript par
Intro to JavaScriptIntro to JavaScript
Intro to JavaScriptYakov Fain
2K vues49 diapositives
Connect.Tech- Level Up Your Game With TravisCI par
Connect.Tech- Level Up Your Game With TravisCIConnect.Tech- Level Up Your Game With TravisCI
Connect.Tech- Level Up Your Game With TravisCIstable|kernel
239 vues67 diapositives

Tendances(20)

Effective JavaFX architecture with FxObjects par Srikanth Shenoy
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
Srikanth Shenoy2K vues
Paris Web - Javascript as a programming language par Marco Cedaro
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
Marco Cedaro11.5K vues
Node.JS error handling best practices par Yoni Goldberg
Node.JS error handling best practicesNode.JS error handling best practices
Node.JS error handling best practices
Yoni Goldberg13.7K vues
Connect.Tech- Level Up Your Game With TravisCI par stable|kernel
Connect.Tech- Level Up Your Game With TravisCIConnect.Tech- Level Up Your Game With TravisCI
Connect.Tech- Level Up Your Game With TravisCI
stable|kernel239 vues
Software Uni Conf October 2014 par Nayden Gochev
Software Uni Conf October 2014Software Uni Conf October 2014
Software Uni Conf October 2014
Nayden Gochev3.8K vues
Working Effectively With Legacy Code par scidept
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
scidept1.9K vues
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov par Nayden Gochev
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Nayden Gochev6.2K vues
SoftwareUniversity seminar fast REST Api with Spring par Nayden Gochev
SoftwareUniversity seminar fast REST Api with SpringSoftwareUniversity seminar fast REST Api with Spring
SoftwareUniversity seminar fast REST Api with Spring
Nayden Gochev5.1K vues
Design patterns revisited with PHP 5.3 par Fabien Potencier
Design patterns revisited with PHP 5.3Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
Fabien Potencier67.1K vues
Exploring Angular 2 - Episode 1 par Ahmed Moawad
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
Ahmed Moawad681 vues
The Basic Concept Of IOC par Carl Lu
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
Carl Lu454 vues
Intro To JavaScript Unit Testing - Ran Mizrahi par Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi2.4K vues
Create Your Own Framework by Fabien Potencier par Himel Nag Rana
Create Your Own Framework by Fabien PotencierCreate Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien Potencier
Himel Nag Rana1.4K vues
Angular Weekend par Troy Miles
Angular WeekendAngular Weekend
Angular Weekend
Troy Miles1.2K vues
Functional programming principles and Java 8 par Dragos Balan
Functional programming principles and Java 8Functional programming principles and Java 8
Functional programming principles and Java 8
Dragos Balan1.5K vues

Similaire à Understanding Framework Architecture using Eclipse

WebNet Conference 2012 - Designing complex applications using html5 and knock... par
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
1.6K vues36 diapositives
Example Of Import Java par
Example Of Import JavaExample Of Import Java
Example Of Import JavaMelody Rios
5 vues44 diapositives
The Web on OSGi: Here's How par
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's Howmrdon
8.3K vues47 diapositives
Adding a modern twist to legacy web applications par
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
345 vues60 diapositives
Spring boot par
Spring bootSpring boot
Spring bootNexThoughts Technologies
519 vues53 diapositives
Bring the fun back to java par
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
640 vues32 diapositives

Similaire à Understanding Framework Architecture using Eclipse(20)

WebNet Conference 2012 - Designing complex applications using html5 and knock... par Fabio Franzini
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini1.6K vues
The Web on OSGi: Here's How par mrdon
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
mrdon8.3K vues
Adding a modern twist to legacy web applications par Jeff Durta
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
Jeff Durta345 vues
Bring the fun back to java par ciklum_ods
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods640 vues
SystemVerilog OOP Ovm Features Summary par Amal Khailtash
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
Amal Khailtash8.4K vues
Selenium & PHPUnit made easy with Steward (Berlin, April 2017) par Ondřej Machulda
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda1.4K vues
The 90-Day Startup with Google AppEngine for Java par David Chandler
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
David Chandler1.4K vues
Release with confidence par John Congdon
Release with confidenceRelease with confidence
Release with confidence
John Congdon1.8K vues
Final Report Towards The Fulfillment Of My Course Cs5020 (... par Julie Kwhl
Final Report Towards The Fulfillment Of My Course Cs5020 (...Final Report Towards The Fulfillment Of My Course Cs5020 (...
Final Report Towards The Fulfillment Of My Course Cs5020 (...
Julie Kwhl4 vues
Intro To Spring Python par gturnquist
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
gturnquist5.8K vues
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin par Fwdays
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
Fwdays83 vues
iPhone development from a Java perspective (Jazoon '09) par Netcetera
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
Netcetera562 vues

Dernier

GSoC 2024 par
GSoC 2024GSoC 2024
GSoC 2024DeveloperStudentClub10
79 vues15 diapositives
Narration ppt.pptx par
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptxTARIQ KHAN
135 vues24 diapositives
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx par
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxDebapriya Chakraborty
655 vues81 diapositives
Class 10 English lesson plans par
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plansTARIQ KHAN
288 vues53 diapositives
Google solution challenge..pptx par
Google solution challenge..pptxGoogle solution challenge..pptx
Google solution challenge..pptxChitreshGyanani1
131 vues18 diapositives
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx par
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxISSIP
369 vues50 diapositives

Dernier(20)

Narration ppt.pptx par TARIQ KHAN
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN135 vues
Class 10 English lesson plans par TARIQ KHAN
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plans
TARIQ KHAN288 vues
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx par ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP369 vues
Education and Diversity.pptx par DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar173 vues
REPRESENTATION - GAUNTLET.pptx par iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood100 vues
Community-led Open Access Publishing webinar.pptx par Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc93 vues
AI Tools for Business and Startups par Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov107 vues
JiscOAWeek_LAIR_slides_October2023.pptx par Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc96 vues
Are we onboard yet University of Sussex.pptx par Jisc
Are we onboard yet University of Sussex.pptxAre we onboard yet University of Sussex.pptx
Are we onboard yet University of Sussex.pptx
Jisc96 vues
PLASMA PROTEIN (2).pptx par MEGHANA C
PLASMA PROTEIN (2).pptxPLASMA PROTEIN (2).pptx
PLASMA PROTEIN (2).pptx
MEGHANA C68 vues
Use of Probiotics in Aquaculture.pptx par AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL100 vues
UWP OA Week Presentation (1).pptx par Jisc
UWP OA Week Presentation (1).pptxUWP OA Week Presentation (1).pptx
UWP OA Week Presentation (1).pptx
Jisc88 vues
The Accursed House by Émile Gaboriau par DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta201 vues

Understanding Framework Architecture using Eclipse

  • 1. Eclipse as a framework of frameworks (Please view in presentation mode for desired flow of information) Anshu Jain IBM Research - India [email_address] anshunjain {gmail, twitter, googlesites)
  • 2.
  • 3.
  • 4.
  • 5. What are we doing today Building a VERY simple calculator
  • 6. V1 - Monolithic Class
  • 7.
  • 8.
  • 9. The only constant - Change 1. Add new features – New functions 2. Fix existing features – Divide by Zero
  • 10. The only constant – Change..!! private void addFunctions(Composite functionComposite) { … … Button xpoweryButton = new Button(functionComposite, SWT. NONE ); xpoweryButton.addSelectionListener( new ButtonSelectionListener( &quot;+&quot; )); xpoweryButton.setLayoutData(data); xpoweryButton.setText( &quot;x^y&quot; ); Button modButton = new Button(functionComposite, SWT. NONE ); addButton.addSelectionListener( new ButtonSelectionListener( &quot;Mod&quot; )); modButton.setLayoutData(data); modButton.setText( &quot;Mod&quot; ); private int divide( int a, int b) { if (b == 0) { text .setText( &quot;DivideBy0 Error!&quot; ); return -1; } else { if (a % b == 0) { text .setText( &quot;Not absolute&quot; ); return a % b; } return a / b; } }
  • 11.
  • 12.
  • 13. V2 Refactoring – Separation of concern
  • 14. V2 Refactoring – Separation of Concern Encapsulation
  • 15.
  • 16. V3 – Thought ful Refactoring We still need to reference each function in calculator Code of createButton is common
  • 17. V4 - Thoughtful Inheritance
  • 18.
  • 19.
  • 20. Where to look for Any folder in my working directory becomes a function
  • 21. Where to look for Nah..!! Not any folder..!!
  • 23.
  • 24. V5 – Dynamic Runtime - Dynamic loading of this jar (Classloading) - Dynamic instantiation of this class(Reflection)
  • 25. V6 - Dynamic Discovery and Loading public void load(Calculator_Original calculator, String installDirectory) throws InstantiationException, IllegalAccessException { try { String[] nameOfFunctions = loadFunctionsFromDirectory(installDirectory); IFunction[] functions = new IFunction[nameOfFunctions. length ]; MyCustomClassLoader loader = new MyCustomClassLoader( installDirectory); for (IFunction function : functions) { Class functionClass = loader.loadClass( &quot;&quot; ); function = (IFunction) functionClass.newInstance(); function.setCalculator(calculator); } } catch (ClassNotFoundException e) { // Handle this } }
  • 26.
  • 27.
  • 28. Revisiting our framework Separation of Concern Componentization Abstraction/Interface Registration and Discovery Dynamic Loading
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. Component Model - Identification - add.cff - add.jar - Component Identifier - Component runtime info
  • 36. Component Model - Identification BUNDLES - Manifest.MF - <bundlename>.jar - Bundle ID - Runtime Info: Classpath - blah..blah..
  • 37.
  • 38. Component Model – Other APIs Framework for observing other components and services Resource and class loading Dynamic management of dependencies Hooks to component lifecycle Service oriented component management
  • 39.
  • 40. Framework for discovery Who wants to let others extend them? Who wants to extend? Who is extending me? Configuration provided by the extenders Properties of extenders I am lazy to even load the runtime Dynamic management of extenders
  • 41.
  • 42.
  • 43.
  • 44.

Notes de l'éditeur

  1. Board Exercise: What are the standard programs you have written so far ? Give examples…!!