SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Madhu Samuel  |  eclipseBible.com Patterns  in  Eclipse
Pattern Recognition Machine Brain  
Patterns of Sound Waves
Our Craft Software  Development
Problem!
What is the one constant  in  Software Development?
Change!
Patterns “ A proven way of  solving a problem” Solution
Motivation for Patterns “ Separate things that change from things that stay the same”
Inheritance  –  “is a” Car Maruti Zen Tata Indica
Composition  –  “has a” Car Steering Wheel
Goal Loosely Coupled Systems
Patterns Creational Structural Behavioral Creational
Creational Patterns To isolate  object creation  from the rest of the application.
Structural Patterns To realize the  relationship between objects .
Behavioral Patterns To realize the  communication between objects .
Patterns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Singleton   Pattern in Platform Services
[object Object],[object Object]
[object Object],[object Object]
Observer   Pattern in Workspace Listener
Subject Observer - 1 Observer - 2 Observer - n “ When the subject’s state changes, the subject notifies all the observers about the event” notifies
[object Object],[object Object],IWorkspace ,[object Object],IResourceChangeListener Sample_Observer Subject Observers ,[object Object],[object Object],IWorkspace
Strategy Pattern &  Viewers
TableViewer Requirement  :  Add Sort Behavior ,[object Object]
TableViewer Requirement  :  Add  Multiple   Sort Behavior ,[object Object],TableViewerAlphaSort ,[object Object],TableViewerNumberSort ,[object Object]
“ Strategy  - Customize an object without subclassing” ,[object Object],TableViewer ,[object Object],ViewerSorter ViewerAlphaSorter ,[object Object],ViewerNumberSorter ,[object Object]
“ Strategy pattern allows to change the behavior at runtime.”
Composite   Pattern in SWT
“ Objects are grouped in a tree structure using  Composition ” CheckBox Shell Group RadioButton
Widget Control Label Button abstract Button Composite 0..* Shell shell =  new  Shell(); new  Button(shell,  SWT. NONE ); getChildren()
Proxy   Pattern in Eclipse File System
Dictionary a person autorized to act for another OOP   an  Object  autorized to act for another Eclipse “ IFile”  is autorized to act for  “ file system” Proxy
IFile FileSystem
[object Object],[object Object],[object Object],[object Object],The proxy objects ( Handles ),
[object Object],[object Object],[object Object],[object Object],Handle Characteristics
IFile File API Non-API Proxy!
You can navigate the tree of files in  NO time! Advantage :
Visitor   Pattern in Workspace Traversal
IProject IFolder IFile
[object Object],IProject ,[object Object],IFolder ,[object Object],IFile OR!
Visitor Pattern “ Add a new operation to a structure of objects, without changing the objects”
IProject IFolder IFolder IFile IFile IFile Visitor
[object Object],[object Object]
[object Object],IResource ,[object Object],IResourceVisitor ElementTree ElementTreeIterator
Memento   Pattern & Workbench State
“ Without violating encapsulation, Save an object’s internal state to restore later” ,[object Object],[object Object],WorkBench IMemento
IAdaptable
IFile
IFile IPropertySource Non-UI UI IFile IFile IFile IPropertySource IFile
1. How to add IPropertySource to IFile without exposing it in the type? 2. How to add new behavior to IFile?
Extension Object Pattern “ Extension object lets you add interfaces to a class”
IAdaptable getAdapter(Class adapter); IFile
public   interface   IAdaptable  { public  Object  getAdapter ( class  adapter); } ( IPropertySource ) file. getAdapter ( IPropertySource . class ); IPropertySource   propertySource =
IAdaptable getAdapter(Class adapter); IFile AdapterManager adapter AdapterFactory 0..*
Object getAdatper(Object object, class adapter) { if(adapter.equals(IPropertySource.class) { return new FilePropertySource ((IFile)object);   } }
Done!
Eclipse  Training ,[object Object],[object Object],[object Object],[object Object],[object Object]
Advanced - Training ,[object Object],[object Object],[object Object],[object Object]
EclipseBible.com - Beta!
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions ?
Notice   You can use these slides only for  Not-For-Profit  purposes.
My Contact  [email_address]
 

Weitere ähnliche Inhalte

Was ist angesagt?

android content providers
android content providersandroid content providers
android content providers
Deepa Rani
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net framework
Ashish Verma
 

Was ist angesagt? (20)

Asp net
Asp netAsp net
Asp net
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
 
Asp.net caching
Asp.net cachingAsp.net caching
Asp.net caching
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Sqlite
SqliteSqlite
Sqlite
 
android content providers
android content providersandroid content providers
android content providers
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Virtual machines and containers
Virtual machines and containersVirtual machines and containers
Virtual machines and containers
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
 
Net framework
Net frameworkNet framework
Net framework
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net framework
 
Lazy vs. Eager Loading Strategies in JPA 2.1
Lazy vs. Eager Loading Strategies in JPA 2.1Lazy vs. Eager Loading Strategies in JPA 2.1
Lazy vs. Eager Loading Strategies in JPA 2.1
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best Practices
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
What is dotnet (.NET) ?
What is dotnet (.NET) ?What is dotnet (.NET) ?
What is dotnet (.NET) ?
 
Android data binding
Android data bindingAndroid data binding
Android data binding
 
Android application-component
Android application-componentAndroid application-component
Android application-component
 

Andere mochten auch

Laura Huser's Design Portf
Laura Huser's Design PortfLaura Huser's Design Portf
Laura Huser's Design Portf
laura_huser
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
Ajay K
 
Sydney Sales Corporation - Introduction
Sydney Sales Corporation - IntroductionSydney Sales Corporation - Introduction
Sydney Sales Corporation - Introduction
Abhay K
 
Microsoft Word - 2_E_N_238
Microsoft Word - 2_E_N_238Microsoft Word - 2_E_N_238
Microsoft Word - 2_E_N_238
Longchrea NEAK
 

Andere mochten auch (20)

Eclipse the Rich Client Platform - Jeff McAffer, Eclipse Architect, IBM
Eclipse the Rich Client Platform - Jeff McAffer, Eclipse Architect, IBMEclipse the Rich Client Platform - Jeff McAffer, Eclipse Architect, IBM
Eclipse the Rich Client Platform - Jeff McAffer, Eclipse Architect, IBM
 
ÉTICA PROFESIONAL
ÉTICA PROFESIONALÉTICA PROFESIONAL
ÉTICA PROFESIONAL
 
academic and proof
academic and proofacademic and proof
academic and proof
 
Laura Huser's Design Portf
Laura Huser's Design PortfLaura Huser's Design Portf
Laura Huser's Design Portf
 
REA13_PREVIEW_Final
REA13_PREVIEW_FinalREA13_PREVIEW_Final
REA13_PREVIEW_Final
 
9th grade dance flyer
9th grade dance flyer9th grade dance flyer
9th grade dance flyer
 
Isabelle Coudere - Interior designer - Portfolio - Book
Isabelle Coudere - Interior designer - Portfolio - BookIsabelle Coudere - Interior designer - Portfolio - Book
Isabelle Coudere - Interior designer - Portfolio - Book
 
Afifeh Halabi Editorial Design Portfolio
Afifeh Halabi Editorial Design PortfolioAfifeh Halabi Editorial Design Portfolio
Afifeh Halabi Editorial Design Portfolio
 
Gramática
GramáticaGramática
Gramática
 
Estructuras de datos
Estructuras de datos Estructuras de datos
Estructuras de datos
 
Bases de datos de informacion y documentación en internet
Bases de datos de informacion y documentación en internetBases de datos de informacion y documentación en internet
Bases de datos de informacion y documentación en internet
 
Portfolio – black and white images
Portfolio – black and white imagesPortfolio – black and white images
Portfolio – black and white images
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
 
Impact of platformization on your business processes and ERP Landscape
Impact of platformization on your business processes and ERP LandscapeImpact of platformization on your business processes and ERP Landscape
Impact of platformization on your business processes and ERP Landscape
 
Sydney Sales Corporation - Introduction
Sydney Sales Corporation - IntroductionSydney Sales Corporation - Introduction
Sydney Sales Corporation - Introduction
 
Elizabethan Duelling
Elizabethan DuellingElizabethan Duelling
Elizabethan Duelling
 
Colon cancer
Colon cancerColon cancer
Colon cancer
 
Microsoft Word - 2_E_N_238
Microsoft Word - 2_E_N_238Microsoft Word - 2_E_N_238
Microsoft Word - 2_E_N_238
 
Design Portfolio
Design Portfolio Design Portfolio
Design Portfolio
 
Interior Design Portfolio.
Interior Design Portfolio.Interior Design Portfolio.
Interior Design Portfolio.
 

Ähnlich wie Patterns in Eclipse

Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...
Shakir Majeed Khan
 
Stellar Sakai Integration
Stellar Sakai IntegrationStellar Sakai Integration
Stellar Sakai Integration
jiali zhang
 
Stellar Sakai Integration
Stellar Sakai IntegrationStellar Sakai Integration
Stellar Sakai Integration
jiali zhang
 

Ähnlich wie Patterns in Eclipse (20)

Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
EMF Tips n Tricks
EMF Tips n TricksEMF Tips n Tricks
EMF Tips n Tricks
 
Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...
 
Application Frameworks: The new kids on the block
Application Frameworks: The new kids on the blockApplication Frameworks: The new kids on the block
Application Frameworks: The new kids on the block
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Intro to Core Data
Intro to Core DataIntro to Core Data
Intro to Core Data
 
Automation patterns on practice
Automation patterns on practiceAutomation patterns on practice
Automation patterns on practice
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard Views
 
Stellar Sakai Integration
Stellar Sakai IntegrationStellar Sakai Integration
Stellar Sakai Integration
 
Stellar Sakai Integration
Stellar Sakai IntegrationStellar Sakai Integration
Stellar Sakai Integration
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
Javascript talk
Javascript talkJavascript talk
Javascript talk
 
Hibernate
HibernateHibernate
Hibernate
 
Hibernate
HibernateHibernate
Hibernate
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Patterns in Eclipse

Hinweis der Redaktion

  1. Show the bad code example.
  2. The common form of pattern we see is Inheritance and composition.
  3. The common form of pattern we see is Inheritance and composition.
  4. All the objects communicate with each other using composition. And we define the structure of objects using inheritance. These two mechanisms are used to created loosely coupled systems. So that the changes in one area of the software will not propagate to the other areas.
  5. How to structure your objects to get the best yield out of it.
  6. Question – How manyof you believe that I will be able to cover all these patterns in next 40 mins? (4 mins for each pattern).
  7. The singleton pattern ensures that a class has only one instance and provides a global point of access to it.
  8. Code Walkthrough Singleton pattern ensures only one instance of a class exists. One global point of access. Prevent creation of multiple instances.
  9. Code Walkthrough Singleton pattern ensures only one instance of a class exists. One global point of access. Prevent creation of multiple instances.
  10. Right now, all of you are the observers, and I am the subject. You people are watching me. Ie, a 100 observers are watching one subject. This is the concept of Observer Pattern.
  11. Resources in the workspace can change either as a result of manipulating them inside eclipse or from changes from the local file system. (if time is there, include NotificationManager)
  12. This kind of design is not scalable, as the no: of sort behaviour increases, you need to increase the sub classes. Moreover, design principles says to ‘favour composition over inheritance’. Your table viewer changes when ever a new sort mechanism is added. Soln – Move the sorting logic out of table viewer.
  13. You have a treeViewer or TableViewer and you want to add behaviours like sorting and filtering to the viewer. One way to add behavior is to subclass the viewer like ‘SortedTableViewer’ or ‘FilteredTableViewer’. But this will just add to the complexity. The solution is implemented using the strategy pattern. Strategy pattern allows you to customize the behavior of an object without subclassing.
  14. A proxy is a class functioning as an interface to another class. We need a proxy b’cos access the file directly from file system is an expensive affair. And IFile represents an in-memory represenation on a file.
  15. IFile implementation knows only the path to the resource.
  16. Clients need a way track to the resources in the file system. These can be files or folders. The files can change over its life time. Files can be created, modified or deleted. Eclipse gives a handle to the resouce, not the actual resource in the file system. This design is achieved using the Proxy and Bridge patterns. We will see only th proxy pattern here.
  17. VO – once created none of their fields change.
  18. You can naigate the tree of files in almost no time. When yo use the file system you have to make many queries to the undelying OS.
  19. The filter method is added in a visitor object. The visitor object traverses through the tree.
  20. Explain all four classes. Show the elementTree in eclipse.
  21. StandardPropertiesAdapterFactory
  22. Details training session on pattersn – where the design patterns are explored and usecases are taken from eclipse.