• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Identify these patterns...

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A) Implementing the grammar is easy too.
B) simplifies the aggregate interface
C) It promotes consistency among products
D) Sharing of objects
E) Families of related algorithms
F) A choice of implementation
G) Reduced Name space
H) Specifying new objects by varying value
I) Provides hooks for subclass
Regards,
Guru
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a question somewhere in there?
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and do your own homework ...
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gurumurthy,
I suggest you read GoF book.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
E) Families of related algorithms,C) It promotes consistency among products
- Abstract factory pattern
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
B) Iterator pattern
D) Composite pattern
E) Factory method pattern
F) Chain of resopnsibility
Thanx
- SCJP2
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is E fatory method pattern. It should be abstarct factory method pattern
 
Ishita Gupta
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,
Yes u r right Pradeep, E should be Abstract factory pattern.
But what about the others i mentioned, are'nt they all correct.
In the meanwhile i ll try to figure out what others are.
Thanx
-SCJP2
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A is interpreter pattern.
Book promotions are nice ways to get home work questions done. How I wish Javaranch was there when I was in college.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gurumurthy Ramamurthy:
A) Implementing the grammar is easy too.


Grammar sounds a little bit like Interpreter, but I actually don't grok the description...


B) simplifies the aggregate interface
C) It promotes consistency among products


I don't understand these.


D) Sharing of objects


Could be Flyweight?


E) Families of related algorithms
F) A choice of implementation


Could both be Strategy.
Why do you think E is Abstract Factory???


G) Reduced Name space
H) Specifying new objects by varying value


Again, I don't even get the question.


I) Provides hooks for subclass


Template Method?
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Strategy pattern is very useful for situations where you would like to dynamically swap the algorithms used in an application.
Strategy is intended to provide you with a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. Strategy lets the algorithms vary independently from clients that use them.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C) It promotes consistency among products


Cant this be abstract factory?
I understand consistency as using related products together as a family.
I am totally confused.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A) Implementing the grammar is easy too. - Interpreter
B) simplifies the aggregate interface - Iterator
C) It promotes consistency among products - Abstract Factory
D) Sharing of objects - Flyweight
E) Families of related algorithms -Strategy
F) A choice of implementation - Strategy
G) Reduced Name space - Singleton
H) Specifying new objects by varying value - Prototype
I) Provides hooks for subclass - Factory method
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Nambu java (Namrata Bibodi)", please check your private messages for a JavaRanch administrative matter.
 
Your mother was a hamster and your father was a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic