SlideShare a Scribd company logo
Iterator Pattern Presented by Baljeet Sandhu - 21 st  June 06 Based on  Head First Design Patterns  by  Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Scenario
Inventory Item - Common to both divisions
Desktop division – Inventory Manager
Laptop division – Inventory manager
Inventory Printer
Encapsulate iteration
Implement Iterator for Laptop Division
The new design..
InventoryPrinter revised
What did we improve.. ,[object Object],[object Object],Use an interface, uniform way of accessing collections
Iterator pattern Provides a way to access the elements of an aggregate object without exposing its  underlying representation

More Related Content

Viewers also liked

Java Design Patterns: The State Pattern
Java Design Patterns: The State PatternJava Design Patterns: The State Pattern
Java Design Patterns: The State Pattern
Antony Quinn
 
Getting Started with IntelliJ IDEA as an Eclipse User
Getting Started with IntelliJ IDEA as an Eclipse UserGetting Started with IntelliJ IDEA as an Eclipse User
Getting Started with IntelliJ IDEA as an Eclipse User
ZeroTurnaround
 
Composite pattern
Composite patternComposite pattern
Composite pattern
Shakil Ahmed
 
Visitor Pattern
Visitor PatternVisitor Pattern
Visitor Pattern
Ider Zheng
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
Ferdous Mahmud Shaon
 
JAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp conceptsJAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp concepts
Rahul Malhotra
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
Kanda Runapongsa Saikaew
 
Design Pattern introduction
Design Pattern introductionDesign Pattern introduction
Design Pattern introduction
neuros
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
Murat Yener
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editor
Santosh Kumar Kar
 
Prototype pattern
Prototype patternPrototype pattern
Prototype pattern
Shakil Ahmed
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
Doncho Minkov
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
Kasun Indrasiri
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
Jeff Fox
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
用JavaScript 實踐《軟體工程》的那些事兒!
用JavaScript  實踐《軟體工程》的那些事兒!用JavaScript  實踐《軟體工程》的那些事兒!
用JavaScript 實踐《軟體工程》的那些事兒!
鍾誠 陳鍾誠
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
Robert MacLean
 

Viewers also liked (19)

Java Design Patterns: The State Pattern
Java Design Patterns: The State PatternJava Design Patterns: The State Pattern
Java Design Patterns: The State Pattern
 
Getting Started with IntelliJ IDEA as an Eclipse User
Getting Started with IntelliJ IDEA as an Eclipse UserGetting Started with IntelliJ IDEA as an Eclipse User
Getting Started with IntelliJ IDEA as an Eclipse User
 
Composite pattern
Composite patternComposite pattern
Composite pattern
 
Visitor Pattern
Visitor PatternVisitor Pattern
Visitor Pattern
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 
JAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp conceptsJAVA design patterns and Basic OOp concepts
JAVA design patterns and Basic OOp concepts
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
 
Design Pattern introduction
Design Pattern introductionDesign Pattern introduction
Design Pattern introduction
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editor
 
Prototype pattern
Prototype patternPrototype pattern
Prototype pattern
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
用JavaScript 實踐《軟體工程》的那些事兒!
用JavaScript  實踐《軟體工程》的那些事兒!用JavaScript  實踐《軟體工程》的那些事兒!
用JavaScript 實踐《軟體工程》的那些事兒!
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 

More from melbournepatterns

An Introduction to
An Introduction to An Introduction to
An Introduction to
melbournepatterns
 
State Pattern from GoF
State Pattern from GoFState Pattern from GoF
State Pattern from GoF
melbournepatterns
 
Concurrency Patterns
Concurrency PatternsConcurrency Patterns
Concurrency Patterns
melbournepatterns
 
Continuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and FlotContinuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and Flot
melbournepatterns
 
Command Pattern
Command PatternCommand Pattern
Command Pattern
melbournepatterns
 
Code Contracts API In .Net
Code Contracts API In .NetCode Contracts API In .Net
Code Contracts API In .Net
melbournepatterns
 
LINQ/PLINQ
LINQ/PLINQLINQ/PLINQ
LINQ/PLINQ
melbournepatterns
 
Gpu Cuda
Gpu CudaGpu Cuda
Facade Pattern
Facade PatternFacade Pattern
Facade Pattern
melbournepatterns
 
Phani Kumar - Decorator Pattern
Phani Kumar - Decorator PatternPhani Kumar - Decorator Pattern
Phani Kumar - Decorator Pattern
melbournepatterns
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
melbournepatterns
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
melbournepatterns
 
Prototype Design Pattern
Prototype Design PatternPrototype Design Pattern
Prototype Design Pattern
melbournepatterns
 
Factory Method Design Pattern
Factory Method Design PatternFactory Method Design Pattern
Factory Method Design Pattern
melbournepatterns
 
Abstract Factory Design Pattern
Abstract Factory Design PatternAbstract Factory Design Pattern
Abstract Factory Design Pattern
melbournepatterns
 
A Little Lisp
A Little LispA Little Lisp
A Little Lisp
melbournepatterns
 
State Pattern in Flex
State Pattern in FlexState Pattern in Flex
State Pattern in Flex
melbournepatterns
 
Active Object
Active ObjectActive Object
Active Object
melbournepatterns
 
Extract Composite Talk Andy
Extract Composite Talk AndyExtract Composite Talk Andy
Extract Composite Talk Andy
melbournepatterns
 
Selenium Interpreter
Selenium InterpreterSelenium Interpreter
Selenium Interpreter
melbournepatterns
 

More from melbournepatterns (20)

An Introduction to
An Introduction to An Introduction to
An Introduction to
 
State Pattern from GoF
State Pattern from GoFState Pattern from GoF
State Pattern from GoF
 
Concurrency Patterns
Concurrency PatternsConcurrency Patterns
Concurrency Patterns
 
Continuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and FlotContinuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and Flot
 
Command Pattern
Command PatternCommand Pattern
Command Pattern
 
Code Contracts API In .Net
Code Contracts API In .NetCode Contracts API In .Net
Code Contracts API In .Net
 
LINQ/PLINQ
LINQ/PLINQLINQ/PLINQ
LINQ/PLINQ
 
Gpu Cuda
Gpu CudaGpu Cuda
Gpu Cuda
 
Facade Pattern
Facade PatternFacade Pattern
Facade Pattern
 
Phani Kumar - Decorator Pattern
Phani Kumar - Decorator PatternPhani Kumar - Decorator Pattern
Phani Kumar - Decorator Pattern
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Prototype Design Pattern
Prototype Design PatternPrototype Design Pattern
Prototype Design Pattern
 
Factory Method Design Pattern
Factory Method Design PatternFactory Method Design Pattern
Factory Method Design Pattern
 
Abstract Factory Design Pattern
Abstract Factory Design PatternAbstract Factory Design Pattern
Abstract Factory Design Pattern
 
A Little Lisp
A Little LispA Little Lisp
A Little Lisp
 
State Pattern in Flex
State Pattern in FlexState Pattern in Flex
State Pattern in Flex
 
Active Object
Active ObjectActive Object
Active Object
 
Extract Composite Talk Andy
Extract Composite Talk AndyExtract Composite Talk Andy
Extract Composite Talk Andy
 
Selenium Interpreter
Selenium InterpreterSelenium Interpreter
Selenium Interpreter
 

Recently uploaded

^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
mayaclinic18
 
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
nimaruinazawa258
 
Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!
FinTech Belgium
 
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
sameer shah
 
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
5spllj1l
 
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
5spllj1l
 
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
5spllj1l
 
Fabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio ProblemFabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio Problem
Majid Iqbal
 
RMIT University degree offer diploma Transcript
RMIT University degree offer diploma TranscriptRMIT University degree offer diploma Transcript
RMIT University degree offer diploma Transcript
cahyrnui
 
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
k4ncd0z
 
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptxUnlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
cosmo-soil
 
1.2 Business Ideas Business Ideas Busine
1.2 Business Ideas Business Ideas Busine1.2 Business Ideas Business Ideas Busine
1.2 Business Ideas Business Ideas Busine
Lawrence101
 
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy VisaNew Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
Amit Kakkar
 
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
rlo9fxi
 
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
5spllj1l
 
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdfSeeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
Ashis Kumar Dey
 
University of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma TranscriptUniversity of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma Transcript
tscdzuip
 
What's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightnessWhat's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightness
Labour Market Information Council | Conseil de l’information sur le marché du travail
 
Enhancing Asset Quality: Strategies for Financial Institutions
Enhancing Asset Quality: Strategies for Financial InstitutionsEnhancing Asset Quality: Strategies for Financial Institutions
Enhancing Asset Quality: Strategies for Financial Institutions
shruti1menon2
 
5 Tips for Creating Standard Financial Reports
5 Tips for Creating Standard Financial Reports5 Tips for Creating Standard Financial Reports
5 Tips for Creating Standard Financial Reports
EasyReports
 

Recently uploaded (20)

^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
 
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
 
Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!
 
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...
 
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
 
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
在线办理(UMASS毕业证书)马萨诸塞大学阿默斯特分校毕业证完成信一模一样
 
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
在线办理(TAMU毕业证书)美国德州农工大学毕业证PDF成绩单一模一样
 
Fabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio ProblemFabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio Problem
 
RMIT University degree offer diploma Transcript
RMIT University degree offer diploma TranscriptRMIT University degree offer diploma Transcript
RMIT University degree offer diploma Transcript
 
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
一比一原版(RMIT毕业证)皇家墨尔本理工大学毕业证如何办理
 
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptxUnlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
Unlock-the-Power-of-UAN-Your-Key-to-Secure-Retirement.pptx
 
1.2 Business Ideas Business Ideas Busine
1.2 Business Ideas Business Ideas Busine1.2 Business Ideas Business Ideas Busine
1.2 Business Ideas Business Ideas Busine
 
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy VisaNew Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
New Visa Rules for Tourists and Students in Thailand | Amit Kakkar Easy Visa
 
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
快速制作美国迈阿密大学牛津分校毕业证文凭证书英文原版一模一样
 
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
快速办理(SMU毕业证书)南卫理公会大学毕业证毕业完成信一模一样
 
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdfSeeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
Seeman_Fiintouch_LLP_Newsletter_Jun_2024.pdf
 
University of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma TranscriptUniversity of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma Transcript
 
What's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightnessWhat's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightness
 
Enhancing Asset Quality: Strategies for Financial Institutions
Enhancing Asset Quality: Strategies for Financial InstitutionsEnhancing Asset Quality: Strategies for Financial Institutions
Enhancing Asset Quality: Strategies for Financial Institutions
 
5 Tips for Creating Standard Financial Reports
5 Tips for Creating Standard Financial Reports5 Tips for Creating Standard Financial Reports
5 Tips for Creating Standard Financial Reports
 

Iterator Pattern Baljeet Sandhu 20060621