4. What do you mean by a prototype? Define analysis
prototype

Answer Posted / som shekhar

Prototype is creational design pattern similar to abstract
factory pattern.

Most of you know abstract factory pattern, in the prototype
pattern when you want to create a clone of an object of some
class, then instead of creating directly the clone that
means using new operator and step by step copying the
elements, or you will be calling the copy constructor of the
class.

But in the real time applications we dont want the copy
constructor to be called so it is made as private, and hence
you cannot copy the items, so this design patterns says that
if you want to create the clone of a class, keep the clone
fucntion as virtual in the base class and let the derived
class implement...this is one aspect.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is different between oops and c++

2001


Is abstract thinking intelligence?

592


What is the advantage of oop over procedural language?

625


What is solid in oops?

604


What are benefits of oop?

638






How many human genes are polymorphic?

570


explain sub-type and sub class? atleast u have differ it into 4 points?

1832


What is object-oriented programming? Webopedia definition

723


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1147


Whats oop mean?

591


What are the advantages of polymorphism?

573


What is class in oop with example?

618


What is a null tree?

632


• What are the desirable attributes for memory managment?

1725


What is coupling in oops?

595