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 the point of polymorphism?

578


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1767


Get me an image implementation program.

1550


Where You Can Use Interface in your Project

1416


What is encapsulation in ict?

594






What is methods in oop?

532


what are the ways in which a constructors can be called?

1570


What is advantage of inheritance?

677


what is difference between class template and template class?

2149


Give two or more real cenario of virtual function and vertual object

1845


Do you know about multiple inheritance?

632


What is encapsulation selenium?

549


What is pointer in oop?

528


What is oops and its features?

575


What does no cap mean?

583