What is the Prototype Design Pattern?

  Рет қаралды 11,056

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 19
@Michael_Murithi
@Michael_Murithi 9 ай бұрын
Type of videos i've been waiting from mr. Neetcode gaddemnit
@nang88
@nang88 9 ай бұрын
Goat back at it again
@tomiiglesias5109
@tomiiglesias5109 9 ай бұрын
Love your design pattern videos
@NeetCodeIO
@NeetCodeIO 9 ай бұрын
Full code walkthrough of Prototype: kzbin.info/www/bejne/bouniJeur7Gor6c
@enlgn7050
@enlgn7050 Ай бұрын
But all the members within the class should also be clonable for a deep copy to happen. The example you provided seems to be one of the trivial scenarios. As per my understanding, we should not be able to do a deep copy only if all the members implement the clonable interface / are primitive data types.
@AmitSingh-tb4bz
@AmitSingh-tb4bz 2 ай бұрын
if the cost variable is private then how come we can fill it in the first go ?
@ahmedabd2259
@ahmedabd2259 9 ай бұрын
Do you just hand write with the mouse? I hear the mouse clicking in the video background
@SAIGOVINDSATISH
@SAIGOVINDSATISH 9 ай бұрын
Sir please post video solutions of weekly contests🙏
@amanuel2135
@amanuel2135 9 ай бұрын
Nice video man
@peachezprogramming
@peachezprogramming 9 ай бұрын
are you sure that new ArrayList(images) performs a deep copy? I just recently implemented this at my work & it didn't work. the ARRAYLIST was a new reference in memory, but each object in the list pointed to the exact same object as before. (Shallow copy vs deep copy). This is VERY important if you intend to modify the underlying objects! also: pin me please
@NeetCodeIO
@NeetCodeIO 9 ай бұрын
It depends on the what the list stores. You're right that if it were a list objects, it would not perform a deep copy. If we were storing primitives like ints, it would create a deep copy. Strings are unique since they are immutable. Technically it's not a deep copy, but since the strings cannot be modified it doesn't matter in this case. But you're definitely correct to point it out.
@walkastray007
@walkastray007 9 ай бұрын
Programming in Java again are we?
@adesh116
@adesh116 9 ай бұрын
Can we have a video on api naming for non CRUD operations or atleast what standard they used to follow at Google. Most videos or tutorials on the internet just cover the basic CRUD stuff. Would be really gratefuly if you can explain how to name apis for more complex use cases like file upload, file download, login, logout, reset password, send otp etc ie conventions for non crud operations.
@harrydayexe
@harrydayexe 9 ай бұрын
Almost every example you gave is a CRUD operation
@adesh116
@adesh116 9 ай бұрын
​@@harrydayexe let's say login.. i felt it's a non crud operation because all u create is a token.. u are not updating nor creating nor deleting a resource from the database.. let me know if my reasoning is wrong here
@ecchioni
@ecchioni 9 ай бұрын
Isn't it just a copy constructor?
@NeetCodeIO
@NeetCodeIO 9 ай бұрын
In some ways, but since they have the same subtype it adds extensibility. In the code walkthrough we clone a list of objs which illustrates this.
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 2,7 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,2 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3 МЛН
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 275 М.
Prototype Design Pattern in Java
18:30
Telusko
Рет қаралды 146 М.
Why Use Design Patterns When Python Has Functions?
23:23
ArjanCodes
Рет қаралды 110 М.
Bridge Pattern - Design Patterns (ep 11)
52:04
Christopher Okhravi
Рет қаралды 147 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Brian Will
Рет қаралды 2,1 МЛН
Become the BEST Python developer on your team
36:48
Powerful Python
Рет қаралды 18 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 321 М.
Factory Method Pattern in Python: Creating Objects with Ease
26:55
campbelltech
Рет қаралды 3,3 М.
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 2,7 МЛН