Topics
Published on November 1, 2017 by kudvenkat

In this video we will learn
1. What is prototype design pattern
2. Implementation guidelines
3. Shallow and deep copy

Gang of Four Definition : “Prototype Design Pattern Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype”

To simplify, instead of creating object from scratch every time, you can make copies of an original instance and modify it as required.

Prototype is unique among the other creational patterns as it doesn’t require a class but only an end object.

We need to choose Prototype Design Pattern when
1. Creating an object is an expensive operation and it would be more efficient to copy an object.
2. System should be independent of how its products are created, composed, and represented.
3. Objects are required that are similar to existing objects.
4. We need to hide the complexity of creating new instance from the client.

Shallow and Deep Copy : The idea of using copy is to create a new object of the same type without knowing the exact type of the object we are invoking.

Shallow Copy : copies an object’s value type fields into the target object and the object’s reference types are copied as references into the target object.

Deep Copy : Deep Copy copies an object’s value and reference types into a complete new copy of the target objects.

In our next video we will discuss the significance of shallow and deep copy in Prototype design pattern.

Text version of the video
csharp-video-tutorials.blogspot.com/2017/11/prototype-design-pattern-introduction.html

Slides
csharp-video-tutorials.blogspot.com/2017/11/prototype-design-pattern-introduction_1.html

Design Patterns Tutorial playlist

Design Patterns Text articles and slides
csharp-video-tutorials.blogspot.com/2017/06/design-patterns-tutorial-for-beginners.html

All Dot Net and SQL Server Tutorials in English
www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

All Dot Net and SQL Server Tutorials in Arabic
www.youtube.com/c/KudvenkatArabic/playlists

Leave a Reply

4 Comments on "ProtoType Design Pattern Introduction"

Notify of
avatar

What Is What?
Guest
What Is What?
5 months 8 days ago

Well this particular series us moving really slow, 14 videos in 6 months.

ruthy Ayele
Guest
ruthy Ayele
5 months 12 days ago

Thanks a lot. nice explanation.

RAQIBUL ALAM RASHED
Guest
RAQIBUL ALAM RASHED
5 months 15 days ago

thanks a billions

RAQIBUL ALAM RASHED
Guest
RAQIBUL ALAM RASHED
5 months 16 days ago

thanks a billions

wpDiscuz