SlideShare une entreprise Scribd logo
1  sur  1
UTAH STATE UNIVERSITY
                                        COMPUTER SCIENCE
                                    CS-7350 Reading Assignment
                                  GoF Patterns: Interpreter, Iterator
                                        Jorge Edison Lascano
                                            Spring 2012
                                             01-27-2012


INTERPRETER, ITERATORGoFPATTERNS

Interpreter, its main intent is interpreting well-structured sentences based on grammars, looking
for sequence of actions that make sense syntactically. One constraint is that it only serves for
simple grammars, then the question is How to measure the complexity of the grammar?. Other
difficulty is the representation of the tree structure (solved in certain way by composite). The
Interpret method represents the main behavior, but it needs help to traverse the structure.
Concluding, this pattern by itself does not solve all the proposed problems by GoF.

The consideration of a complex grammar is still present. It is said that it is helpful for regular
expressions, but not for parsers. So, the complexity could be measured by the level of
(de)composition, or the complexity in the grammatical structure of the sentences.

Iterator, also known as cursor, it´s intent is to allow access to elements sequentially without
exposing their representation. The main use is mentioned as data structure traverse, but, this
feature is already implemented by almost every modern language, namely:Java, C#, Smalltalk in
their Collections. Now, the question is: Is it really necessary to implement an iterator? And the
answer is YES, if we need to implement a different way (than traditional data structures) to
traverse the elements and also if we need to implement multiple traversal ways at the same time.

As this is a behavior pattern, the main concern should be oriented to decide the place where the
traversal algorithm should be implemented. Maybe using a Bridge between the ConcreteIterator
and the ConcreteAggregate could solve this problem.

Contenu connexe

Tendances

referát.doc
referát.docreferát.doc
referát.doc
butest
 
Modular Ontologies: the Package-based Description Logics Approach
Modular Ontologies: the Package-based Description Logics Approach Modular Ontologies: the Package-based Description Logics Approach
Modular Ontologies: the Package-based Description Logics Approach
Jie Bao
 
Constructive Description Logics 2006
Constructive Description Logics 2006Constructive Description Logics 2006
Constructive Description Logics 2006
Valeria de Paiva
 

Tendances (20)

Possible Word Representation
Possible Word RepresentationPossible Word Representation
Possible Word Representation
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational Model
 
Anandkumar novel approach
Anandkumar novel approachAnandkumar novel approach
Anandkumar novel approach
 
CLUE-Aligner: An Alignment Tool to Annotate Pairs of Paraphrastic and Transla...
CLUE-Aligner: An Alignment Tool to Annotate Pairs of Paraphrastic and Transla...CLUE-Aligner: An Alignment Tool to Annotate Pairs of Paraphrastic and Transla...
CLUE-Aligner: An Alignment Tool to Annotate Pairs of Paraphrastic and Transla...
 
Presentation1
Presentation1Presentation1
Presentation1
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
 
D2 anandkumar
D2 anandkumarD2 anandkumar
D2 anandkumar
 
MORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYA
MORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYAMORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYA
MORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYA
 
Ai lecture 07(unit03)
Ai lecture  07(unit03)Ai lecture  07(unit03)
Ai lecture 07(unit03)
 
DETERMINING CUSTOMER SATISFACTION IN-ECOMMERCE
DETERMINING CUSTOMER SATISFACTION IN-ECOMMERCEDETERMINING CUSTOMER SATISFACTION IN-ECOMMERCE
DETERMINING CUSTOMER SATISFACTION IN-ECOMMERCE
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)
 
referát.doc
referát.docreferát.doc
referát.doc
 
A deep analysis of Multi-word Expression and Machine Translation
A deep analysis of Multi-word Expression and Machine TranslationA deep analysis of Multi-word Expression and Machine Translation
A deep analysis of Multi-word Expression and Machine Translation
 
Review of Parsing in Modern Greek - A New Approach
Review of Parsing in Modern Greek - A New ApproachReview of Parsing in Modern Greek - A New Approach
Review of Parsing in Modern Greek - A New Approach
 
Review: Deep contextualized word representations
Review: Deep contextualized word representationsReview: Deep contextualized word representations
Review: Deep contextualized word representations
 
Modular Ontologies: the Package-based Description Logics Approach
Modular Ontologies: the Package-based Description Logics Approach Modular Ontologies: the Package-based Description Logics Approach
Modular Ontologies: the Package-based Description Logics Approach
 
Constructive Description Logics 2006
Constructive Description Logics 2006Constructive Description Logics 2006
Constructive Description Logics 2006
 
Finite state system or finite automata
Finite state system or finite automataFinite state system or finite automata
Finite state system or finite automata
 
Bca3020– data base management system(dbms)
Bca3020– data base management system(dbms)Bca3020– data base management system(dbms)
Bca3020– data base management system(dbms)
 
ESSLLI2016 DTS Lecture Day 5-1: Introduction to day 5
ESSLLI2016 DTS Lecture Day 5-1: Introduction to day 5ESSLLI2016 DTS Lecture Day 5-1: Introduction to day 5
ESSLLI2016 DTS Lecture Day 5-1: Introduction to day 5
 

En vedette (10)

Railsgirls presentation
Railsgirls presentationRailsgirls presentation
Railsgirls presentation
 
Hominidnewby:tonyh
Hominidnewby:tonyhHominidnewby:tonyh
Hominidnewby:tonyh
 
Modalidad de doble programa ua
Modalidad de doble programa uaModalidad de doble programa ua
Modalidad de doble programa ua
 
чомучки
чомучкичомучки
чомучки
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Http
HttpHttp
Http
 
Gerundio. Per chi abbiamo lavorato?
Gerundio. Per chi abbiamo lavorato?Gerundio. Per chi abbiamo lavorato?
Gerundio. Per chi abbiamo lavorato?
 
【エンジニア勉強会】MicrosoftAzure.
【エンジニア勉強会】MicrosoftAzure.【エンジニア勉強会】MicrosoftAzure.
【エンジニア勉強会】MicrosoftAzure.
 
Tema 6.3.
Tema 6.3.Tema 6.3.
Tema 6.3.
 
Deloitte_JCAmado_ClimateResilienceReadinessIndex_Aug25_08072014FINAL
Deloitte_JCAmado_ClimateResilienceReadinessIndex_Aug25_08072014FINALDeloitte_JCAmado_ClimateResilienceReadinessIndex_Aug25_08072014FINAL
Deloitte_JCAmado_ClimateResilienceReadinessIndex_Aug25_08072014FINAL
 

Similaire à Hw6 interpreter iterator GoF

The Valladolid Presentation - Nov, 16, 2011
The Valladolid Presentation - Nov, 16, 2011The Valladolid Presentation - Nov, 16, 2011
The Valladolid Presentation - Nov, 16, 2011
sdemetri
 

Similaire à Hw6 interpreter iterator GoF (20)

Hw4 composite decorator facade flyweight
Hw4 composite decorator facade flyweightHw4 composite decorator facade flyweight
Hw4 composite decorator facade flyweight
 
nlp (1).pptx
nlp (1).pptxnlp (1).pptx
nlp (1).pptx
 
Substitutability
SubstitutabilitySubstitutability
Substitutability
 
Hw7 mediator memento observer
Hw7 mediator memento observerHw7 mediator memento observer
Hw7 mediator memento observer
 
EasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdfEasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdf
 
Transformer Models_ BERT vs. GPT.pdf
Transformer Models_ BERT vs. GPT.pdfTransformer Models_ BERT vs. GPT.pdf
Transformer Models_ BERT vs. GPT.pdf
 
Patterns of Value
Patterns of ValuePatterns of Value
Patterns of Value
 
Language Combinatorics: A Sentence Pattern Extraction Architecture Based on C...
Language Combinatorics: A Sentence Pattern Extraction Architecture Based on C...Language Combinatorics: A Sentence Pattern Extraction Architecture Based on C...
Language Combinatorics: A Sentence Pattern Extraction Architecture Based on C...
 
LFG and GPSG.pptx
LFG and GPSG.pptxLFG and GPSG.pptx
LFG and GPSG.pptx
 
IRJET- Short-Text Semantic Similarity using Glove Word Embedding
IRJET- Short-Text Semantic Similarity using Glove Word EmbeddingIRJET- Short-Text Semantic Similarity using Glove Word Embedding
IRJET- Short-Text Semantic Similarity using Glove Word Embedding
 
Cross-lingual event-mining using wordnet as a shared knowledge interface
Cross-lingual event-mining using wordnet as a shared knowledge interfaceCross-lingual event-mining using wordnet as a shared knowledge interface
Cross-lingual event-mining using wordnet as a shared knowledge interface
 
master_thesis_greciano_v2
master_thesis_greciano_v2master_thesis_greciano_v2
master_thesis_greciano_v2
 
10.1.1.35.8376
10.1.1.35.837610.1.1.35.8376
10.1.1.35.8376
 
Oop Article Jan 08
Oop Article Jan 08Oop Article Jan 08
Oop Article Jan 08
 
NLP Deep Learning with Tensorflow
NLP Deep Learning with TensorflowNLP Deep Learning with Tensorflow
NLP Deep Learning with Tensorflow
 
The Valladolid Presentation - Nov, 16, 2011
The Valladolid Presentation - Nov, 16, 2011The Valladolid Presentation - Nov, 16, 2011
The Valladolid Presentation - Nov, 16, 2011
 
An Ontology For Building A Conceptual Problem Solving Model
An Ontology For Building A Conceptual Problem Solving ModelAn Ontology For Building A Conceptual Problem Solving Model
An Ontology For Building A Conceptual Problem Solving Model
 
Java OOPs Concepts.docx
Java OOPs Concepts.docxJava OOPs Concepts.docx
Java OOPs Concepts.docx
 
Breaking down the AI magic of ChatGPT: A technologist's lens to its powerful ...
Breaking down the AI magic of ChatGPT: A technologist's lens to its powerful ...Breaking down the AI magic of ChatGPT: A technologist's lens to its powerful ...
Breaking down the AI magic of ChatGPT: A technologist's lens to its powerful ...
 
Oop
OopOop
Oop
 

Plus de Edison Lascano

GoF Patterns: Prototype, Singleton, Adapter, Bridge
GoF Patterns: Prototype, Singleton, Adapter, BridgeGoF Patterns: Prototype, Singleton, Adapter, Bridge
GoF Patterns: Prototype, Singleton, Adapter, Bridge
Edison Lascano
 
Abstract Factory and Builder patterns
Abstract Factory and Builder patternsAbstract Factory and Builder patterns
Abstract Factory and Builder patterns
Edison Lascano
 

Plus de Edison Lascano (11)

eXtreme Programming May Be Embedded inside Scrum
eXtreme Programming May Be Embedded inside ScrumeXtreme Programming May Be Embedded inside Scrum
eXtreme Programming May Be Embedded inside Scrum
 
An Infectious Disease Surveillance Simulation (IDSS) in the Cloud
An Infectious Disease Surveillance Simulation (IDSS) in the CloudAn Infectious Disease Surveillance Simulation (IDSS) in the Cloud
An Infectious Disease Surveillance Simulation (IDSS) in the Cloud
 
UML for Aspect Oriented Design
UML for Aspect Oriented DesignUML for Aspect Oriented Design
UML for Aspect Oriented Design
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Hw8 GoF state, strategy, tempate method, visitor
Hw8 GoF state, strategy, tempate method, visitorHw8 GoF state, strategy, tempate method, visitor
Hw8 GoF state, strategy, tempate method, visitor
 
Hw5 proxy, chain of responsability, command
Hw5 proxy, chain of responsability, commandHw5 proxy, chain of responsability, command
Hw5 proxy, chain of responsability, command
 
Hw12 refactoring to factory method
Hw12 refactoring to factory methodHw12 refactoring to factory method
Hw12 refactoring to factory method
 
Hw11 refactoringcreation
Hw11 refactoringcreationHw11 refactoringcreation
Hw11 refactoringcreation
 
GoF Patterns: Prototype, Singleton, Adapter, Bridge
GoF Patterns: Prototype, Singleton, Adapter, BridgeGoF Patterns: Prototype, Singleton, Adapter, Bridge
GoF Patterns: Prototype, Singleton, Adapter, Bridge
 
Abstract Factory and Builder patterns
Abstract Factory and Builder patternsAbstract Factory and Builder patterns
Abstract Factory and Builder patterns
 
GoF design patterns chapters 1 and 2
GoF design patterns chapters 1 and 2GoF design patterns chapters 1 and 2
GoF design patterns chapters 1 and 2
 

Dernier

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Dernier (20)

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

Hw6 interpreter iterator GoF

  • 1. UTAH STATE UNIVERSITY COMPUTER SCIENCE CS-7350 Reading Assignment GoF Patterns: Interpreter, Iterator Jorge Edison Lascano Spring 2012 01-27-2012 INTERPRETER, ITERATORGoFPATTERNS Interpreter, its main intent is interpreting well-structured sentences based on grammars, looking for sequence of actions that make sense syntactically. One constraint is that it only serves for simple grammars, then the question is How to measure the complexity of the grammar?. Other difficulty is the representation of the tree structure (solved in certain way by composite). The Interpret method represents the main behavior, but it needs help to traverse the structure. Concluding, this pattern by itself does not solve all the proposed problems by GoF. The consideration of a complex grammar is still present. It is said that it is helpful for regular expressions, but not for parsers. So, the complexity could be measured by the level of (de)composition, or the complexity in the grammatical structure of the sentences. Iterator, also known as cursor, it´s intent is to allow access to elements sequentially without exposing their representation. The main use is mentioned as data structure traverse, but, this feature is already implemented by almost every modern language, namely:Java, C#, Smalltalk in their Collections. Now, the question is: Is it really necessary to implement an iterator? And the answer is YES, if we need to implement a different way (than traditional data structures) to traverse the elements and also if we need to implement multiple traversal ways at the same time. As this is a behavior pattern, the main concern should be oriented to decide the place where the traversal algorithm should be implemented. Maybe using a Bridge between the ConcreteIterator and the ConcreteAggregate could solve this problem.