No video

Observer Design Pattern in Java

  Рет қаралды 169,228

Telusko

Telusko

Күн бұрын

The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.
Design Pattern in Java : • Design Patterns in Jav...

Пікірлер: 177
@prasadbonam4430
@prasadbonam4430 5 жыл бұрын
I can say one thing " ur examples are so Realistic easy 2 understand" keep it up Good work bro n Thank you :)
@berjaoui92
@berjaoui92 Жыл бұрын
I started following your tutorials in 2017. Now i am a full stack java developer...Thank you a lot
@muhammadsaleh816
@muhammadsaleh816 4 жыл бұрын
You are making life easier for java developers Love from Pakistan :)
@siddharthmohanty7106
@siddharthmohanty7106 3 жыл бұрын
I discovered this channel a few months ago and I'm legit loving it!
@kalidindiprashanth7363
@kalidindiprashanth7363 5 жыл бұрын
Hi naveen, can you also make videos on Java memory management and how to improve performance of java applications.
@karthik-ex4dm
@karthik-ex4dm 4 жыл бұрын
Actually... This is the best video explaining observer pattern I've seen... From yesterday, I've been searching for observer pattern in both python and javascript, didn't find any video that solidified my understanding. I might have watched 5-10 videos (best ones).... I was sceptical at first since this video is in java (I don't know java) but turns out java is not as difficult as its often publicized. I actually understood everything clearly since I know python and JS Naveen's example of KZfaq was on point!!! If he had not taken youtube example, I think it would have been just another observer pattern video Java is also good!!! I'm liking the way it's written Now I'm gonna create this in JS
@BakhtyarQadri
@BakhtyarQadri 5 жыл бұрын
Your thinking way is very appreciatable.Thanks to show me this way of logic building.
@vikramkumar-mi1yk
@vikramkumar-mi1yk 2 жыл бұрын
All the playlists were really very good and informative. Thanks, Navin for such wonderful content.
@user-cq7db9ij1o
@user-cq7db9ij1o 4 жыл бұрын
This is called teaching! Excellent
@yazilk30
@yazilk30 5 жыл бұрын
Its really amazing that....this lengthy process is very easy to understand by you Sir😍😍😍😍
@aswarthanarayanareddyb176
@aswarthanarayanareddyb176 5 жыл бұрын
Every time...learn new from telusko, and waiting for micro services series
@qingsiji1638
@qingsiji1638 4 жыл бұрын
can not agree more,there is nealry no very good lesson for micro services. Waiting for it too. I have watched so many lessons of telusko
@MultiGaurav25
@MultiGaurav25 3 жыл бұрын
@@qingsiji1638 check java brains(Kaushik) for microservices
@jilanishaik8791
@jilanishaik8791 4 жыл бұрын
Easily able to understanding by giving simple examples with clear explainations. Thanks Naveen.
@dr.venugopalrajupalem6526
@dr.venugopalrajupalem6526 4 жыл бұрын
Wonderful explanation and the example of the Observer Pattern I have ever seen! You are my favourite Teacher. Thanks.
@uma4525
@uma4525 4 жыл бұрын
Quick and nice explanations that's very easy to understand - telusko learnings. From this channel ,I have learnt a lot. Thanks much Navin
@theartist8835
@theartist8835 5 жыл бұрын
Actually the observer pattern is much more abstract and braod than that. It has to be general. I know that you are trying to make it simple so everyone understands it, but in doing so, you missed the principle of the observer pattern which is to make code flexible and easy to be added to by creating interfaces and classes that implement the interfaces and then under these implementing classes we can have as many subscribers and channels as we want. The way you did it is just normal java code with no design pattern.
@shivakumar-kh3yp
@shivakumar-kh3yp 5 жыл бұрын
Absolutely true
@backclover9651
@backclover9651 2 ай бұрын
yes brother I thought the same thing
@gigimushi6705
@gigimushi6705 2 жыл бұрын
finaly, with your exemple i understand how to implement the observer pattern. you are the best.
@rayasamkiran
@rayasamkiran 3 жыл бұрын
Thanks for explaining it in lucid way. Few things I noticed.. Subscriber class .. Channel channel = new Channel (); This is not required... You can remove the RHS part as you are doing in setter method.. Another improvement in KZfaq class is ... Unsubscribe is called only from subscriber side but not from channel side...
@subashkannan949
@subashkannan949 Жыл бұрын
well explained🔥Also try to upload the other design patterns as well it will be very useful for us...!!
@khsbangash
@khsbangash 4 жыл бұрын
Hi Navin, Your videos and way of teaching are quite energetic. Even boring subjects you can explain with full of energy. Keep up the good work bro. Love and prayers from Pakistan !
@vishalsingh-dj6od
@vishalsingh-dj6od 4 жыл бұрын
I have watched multiple observer design pattern video, I must say this is the best one and more realistic. Keep it going boss..
@pybrowrynn
@pybrowrynn 5 жыл бұрын
Hello Navin, I have been watching your videos for a while now and I find them very useful. I really wish you could do a live stream some time so that we could interact with you.
@vladanulardzic5859
@vladanulardzic5859 5 жыл бұрын
Par excellence ! Perfect explained. Perfect example. Especially direct programming in the java. Keep on !
@sohankundu448
@sohankundu448 Жыл бұрын
Please continue the series. It would be very much helpful.
@anu608497
@anu608497 4 жыл бұрын
Thanks Telusko. Your examples are very intuitive and helpful. I am able to learn Observable Design Pattern easily now
@shashidharkrovvidi4998
@shashidharkrovvidi4998 5 ай бұрын
such an easy to understand example! thank you :)
@ShadowWalker683
@ShadowWalker683 3 жыл бұрын
Sir, felt great, to be honest. I was struggling with this observer pattern and now it's all a matter of examples - you've made it that easy. And one more thing, with this online studying times, this study feels much more realistic with your appearance. Otherwise, only a study video makes it boring sometimes. Thanks a lot sir.
@mustafahabeb3584
@mustafahabeb3584 9 ай бұрын
thank you very much very simple and easy to understand
@b_1729-j8j
@b_1729-j8j 7 ай бұрын
I purchased a GFG course about System Design but that is not at all good but this video cleared my doubts.
@FadingDreams
@FadingDreams Жыл бұрын
Still helpful after 4 years❤
@cristianflorentintarta885
@cristianflorentintarta885 Жыл бұрын
I am impressed. Kudos. Explanation, engagement and I do not believe that you are getting enough props for ur work. If you have been my high school or college teacher ... :( , but thank you and will keep supporting sir :) :D :}
@priyagupta-ko2mk
@priyagupta-ko2mk 3 жыл бұрын
Thanks Naveen . You have explained it very well.
@PraveenKumar-nq1wg
@PraveenKumar-nq1wg 2 жыл бұрын
Hi Naveen, Kindly make video recordings for all 23 design patterns, hope we have few recordings already and kindly help us with the missed ones.
@sarthakuiit
@sarthakuiit 2 жыл бұрын
Well explained. Just one potential correction - upload() is storing video title to channel title.
@Nelipson
@Nelipson 11 ай бұрын
It should print who is uploading as well and we can use getter for title. The example would be better if there was case without and with observer.
@ranjithv133
@ranjithv133 5 жыл бұрын
Hi Navin, I really have to say this. thank you. you surely are changing my life for good. keep up the good work.
@mananjain9177
@mananjain9177 3 жыл бұрын
Amazing series....can we have more design patterns explained through some more videos under this playlist?
@saninspace
@saninspace 5 жыл бұрын
telesco.subscribe(sn) seems incorrect as channels do not subscribe. Instead s1.subscribeChannel(teleaco) should have called it internally.
@rahulrsavant
@rahulrsavant Жыл бұрын
Thanks, example is matching to observer pattern
@libinthomas5349
@libinthomas5349 2 жыл бұрын
Thanks a lot 🙏 Expecting more videos like this.
@MsGayathri19
@MsGayathri19 5 жыл бұрын
Wow simply explained observer design pattern easily .. thank so
@dien2971
@dien2971 4 жыл бұрын
Your explanation is not academic. It's easy to understand! Thank you I'm just seeing your register numbers are 999K. Wow, congratulations! Hope you reach 1M subcribers point!!
@satyabatigoswami1735
@satyabatigoswami1735 5 жыл бұрын
Thank you sir. I was looking for visitor pattern video and found this new concept. Thanks a lot
@tejeswarpala2841
@tejeswarpala2841 Жыл бұрын
good explanation. so clear now. small doubt: during unsubscribing, only subscriber is removed from the list of subs in the channel object but not the channel field from the subscriber object. forgot ?
@sreekavya5743
@sreekavya5743 4 жыл бұрын
I got very good understanding with ur explanation sir.Thank you!!
@premk191
@premk191 4 жыл бұрын
Hey Naveen, I often get confused on how come Subscriber (Observer) get the update() method. And that method contains the "video uploaded" message. I think managing that message should be responsibility of channel (Subject)
@nandininema7123
@nandininema7123 4 жыл бұрын
Thank you Naveen for your awesome videos.
@dohruba
@dohruba 3 жыл бұрын
Your example was awesome! Thanks, bro :D
@anujgadge5313
@anujgadge5313 3 жыл бұрын
Please continue this series...
@khadijaaitbouiramouin7776
@khadijaaitbouiramouin7776 3 жыл бұрын
Just amazing, a smart way to explain things, Thank u soo much
@NiyatiShah24
@NiyatiShah24 4 жыл бұрын
One doubt - Why are we calling subscribe on Channel and subscribeChannel on Subscriber? Say when a user clicks on subscribe, cant we just call subscribeChannel method, which also takes care of subscribe to that Channel? Since both have to be called inevitably on event, should they not be coupled? Please let me know.
@johnDanu
@johnDanu 5 жыл бұрын
U rocks always... Student of telusko...
@pandiyarajramu749
@pandiyarajramu749 2 жыл бұрын
Good Explanation..Thank you
@crazeeealgorithms3236
@crazeeealgorithms3236 4 жыл бұрын
Superb explanation Thank you Sir...
@Talbuk
@Talbuk 4 жыл бұрын
Hey Telusko, thank you very much for your great videos! I got a simple question, are these patterns static in it's architecture or is it allowed, to change it for special use-cases? I rewrote this pattern by myself just to internalize the idea behind it, but called the method unregisterSubscriber and registerSubscriber from the class channel in the method unSubscribe and subscribe from Subscriber every time a subscription or unsubsctiption from a Subscriber takes place, so that the channel doesn't have to call the method explicitly and only gets informed about the new subscription or unsubscriptions. Also, evey time a new video is being uploaded, I don't call the update-method from subscribers, but send an update method from the channel class to all subscribers. Would that still count as observerpattern or is it strictly required that both sides have to register each other and the update method is in the class of those, who get informed? Keep up the good work, love it!
@VersatileAnthem
@VersatileAnthem 3 жыл бұрын
thank you so much sir. very clear explanation.
@sharjeel_mazhar
@sharjeel_mazhar 2 жыл бұрын
Just mind blowing sir!
@alexissanchezbro
@alexissanchezbro 4 жыл бұрын
Great video code along, this really helped me put the theory into practice. Thank you
@hakobhn
@hakobhn 10 ай бұрын
Thanks for the interesting video. Just wondering, about the subscription method implementation part. Is it correct to keep two diff methods and call them separately? For example, when a subscriber subscribes to some channel, aggregation into the channel's list could be called in that method. Now, you can miss the subsequent subscribeChannel method call for the subscriber, and it will break the logic. I guess, it can be treated as a bug. Isn't it? Thanks
@drakezen
@drakezen 5 жыл бұрын
Since you are making videos of Design Patterns, can you provide explanations of the various patterns using functional style?
@utkarshsharma1867
@utkarshsharma1867 2 ай бұрын
Sir, u r genius !
@raws4209
@raws4209 4 жыл бұрын
thank you for this awesome explanation!!!!
@jayakumargutha
@jayakumargutha 4 жыл бұрын
It's very realistic example. This is more than enough to understand the pattern. Good Convey....
@guitaristsehokim
@guitaristsehokim 4 жыл бұрын
It was awesome to follow all of design pattern videos. Could you cover all the other design patterns as you said we have to know all?
@sangeetagupta7957
@sangeetagupta7957 Жыл бұрын
Superb explanation
@vijayr6540
@vijayr6540 4 жыл бұрын
Very understandable way , thankyou telusko
@rakeshroshan9690
@rakeshroshan9690 4 жыл бұрын
Hi Naveen, Can you make a video on difference between Observer dp, state dp and pub-subs dp
@alimodz6253
@alimodz6253 3 жыл бұрын
you have great explanation skills :D
@msk9414
@msk9414 2 жыл бұрын
Subscriber class should not create "new" Channel Object every time (Subscriber.java : line 6), but rather a single channel should be created in KZfaq.java, and passed as dependency every time new subscriber object is created(either in constructor or as setter ), so that there is only one Channel object and multiple subscribers. Subscribers can then subscribe to the injected "Channel" object and get notified of any new videos uploaded by the channel.
@vedrathi2346
@vedrathi2346 5 жыл бұрын
Can you please make more python videos, some suggestions can be algorithms and ai, games using pygame, ethical hacking, data analysis and data visualization.
@vishnuvardhanreddy8584
@vishnuvardhanreddy8584 5 жыл бұрын
Yeah I always waiting for your video content .... Everytime
@sanjaypattnaik3288
@sanjaypattnaik3288 4 жыл бұрын
Great Explanation. Good Example.
@catlord69
@catlord69 4 жыл бұрын
Amazing explanation !
@alinehme1412
@alinehme1412 2 жыл бұрын
Crystal clear, thanks a lot!
@yogpooja-vq1pp
@yogpooja-vq1pp 4 жыл бұрын
Hi Naveen, you are doing superb job. I just have a doubt in this Observer DP. We are calling telusko.subscribe(s1)... methods inside KZfaq class. but if we are already calling s1.subscribeChannel(telusko) then it shouldn't be necessary right?
@kishorgowda6138
@kishorgowda6138 4 жыл бұрын
Simply super😍🤟Thanks..
@bl7327
@bl7327 Жыл бұрын
U just earned a subscriber.
@ThaiCaliforniacom
@ThaiCaliforniacom 5 жыл бұрын
Awesome I can use this concept with JavaScript too. Thanks a lot
@mujtabakamal9538
@mujtabakamal9538 4 жыл бұрын
Hi, I have been working with TCP Socket, I want to know how can we observe data from socket and pass it to view (web page/jsp) in (Java Spring boot). Like a Real time data, to show Stock Market stats, with using any timer. Can you please help me with this issue. Thanks
@abdulrehman036
@abdulrehman036 2 жыл бұрын
Can you also include UML diagram for each pattern. Then your video will become one stop solution.
@satishmohapatra95_009
@satishmohapatra95_009 4 жыл бұрын
Hi Navin, Can you please upload more design pattern video, If possible can you please give any existing example which Java is used internally.
@yasna1979iravani
@yasna1979iravani 3 жыл бұрын
how to notify the subject that an observer has unsubscribed???
@udhayasankar113
@udhayasankar113 5 жыл бұрын
Great work sir...pls make a design pattern series
@MDASIF-wo7ck
@MDASIF-wo7ck 5 жыл бұрын
Actually very nice example.....
@jayantkandpal3784
@jayantkandpal3784 5 жыл бұрын
Hey naveen, is it the same while implementing the code logic for suscriber notification for such a big platform like youtube or some db coding and logics are also required?
@ibo3099
@ibo3099 4 жыл бұрын
you could've put the subscribeChannel method inside the subscribe method. Still a great vid
@ninadsentinel
@ninadsentinel 3 жыл бұрын
Is this solution not susceptible to concurrent modification exception if there are additions and removal all at once in subscriber list assuming the subscribe and unsubscribe events would happen independently in separate threads in real world
@joejones5746
@joejones5746 3 жыл бұрын
Brilliant analogy !!!
@nagank90
@nagank90 5 жыл бұрын
Great explanation thank you so much.
@rjoconnor3443
@rjoconnor3443 3 жыл бұрын
V good clear video
@kaarthikchinni
@kaarthikchinni Жыл бұрын
Awesome sir... 🙂
@amyd7041
@amyd7041 5 жыл бұрын
Great content! Thank you so much 👍🏻
@seanhlulani6137
@seanhlulani6137 3 жыл бұрын
hello sir, aint u suppose to use interfaces instead? because we got so many methods which end up confusing..
@shikharchaudhary6984
@shikharchaudhary6984 4 жыл бұрын
Amazing explanation
@alfonsogangemi7152
@alfonsogangemi7152 5 жыл бұрын
Good. Should you explain the same pattern using java.util.Observable?
@domenico2178
@domenico2178 4 жыл бұрын
With Observable is same thing. You Just have to extend class Observable and implements Observer interface and then overriding or implements their methods (update and notify). In this example Subject is the channel and it extend the Observable superclass while Subscriber is the Observer, so it must implements Observer interface
@saurbhdhoble
@saurbhdhoble 5 жыл бұрын
Just a random question, I have lot of nested if else statement in my project, how to avoid using nested if else?
@ravindranarayan9843
@ravindranarayan9843 4 жыл бұрын
Hi boss.. it is better to tell the basic definition of the pattern before going to concept and how it is implemented.. please add definition for all the patterns you have explained.
@smeeangle
@smeeangle 5 жыл бұрын
In 11:42 kindly elaborate why perform s1.subscribeToChannel(telusko); I tried without it then video title got null . Thank you .
@yogeshdhavan1550
@yogeshdhavan1550 3 жыл бұрын
W'll inform everyone..hahaha...best explanation ever
@vitorpereira316
@vitorpereira316 4 жыл бұрын
Thank you so much Telusko
@bhushanbhange7065
@bhushanbhange7065 4 жыл бұрын
@Telusko @Navin which software do you use to create video. Presentation and you video in it
Prototype Design Pattern in Java
18:30
Telusko
Рет қаралды 142 М.
Observer Pattern - Design Patterns (ep 2)
49:47
Christopher Okhravi
Рет қаралды 561 М.
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 32 МЛН
艾莎撒娇得到王子的原谅#艾莎
00:24
在逃的公主
Рет қаралды 39 МЛН
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 332 М.
SOLID Design Principles in java with Example | JavaTechie
34:44
Java Techie
Рет қаралды 184 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,2 МЛН
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Design Patterns in Plain English | Mosh Hamedani
1:20:01
Programming with Mosh
Рет қаралды 1,3 МЛН
What is the Observer Pattern? (Software Design Patterns)
21:49
Be A Better Dev
Рет қаралды 21 М.
Observer Design Pattern in detail | Interview Question
8:03
Daily Code Buffer
Рет қаралды 8 М.