Thank you :) Yes, design patterns are learned through practice. When a programmer gets to the point in which they begin studying topics like patterns, refactoring, OOD, etc. they have to become an artist rather then a rule follower. Most programmers never progress to that point. Anyone can paint by numbers, but great programmers expand their canvas through practice. Just my opinion
@pharoah3275 жыл бұрын
Well stated
@derekbanas11 жыл бұрын
You are correct that String.equals should be used, but == works in this situation because the == operator checks whether the references to the objects are equal.
@derekbanas11 жыл бұрын
You're very welcome :) I only do this because you guys have been so nice to me.
@derekbanas12 жыл бұрын
Thank you very much. I'm glad you're finding it useful :)
@derekbanas11 жыл бұрын
Thank you :) I'm glad you enjoy them. Yes you are correct it would be bad to eliminate that. At the time I deleted it just to get it out of the way.
@derekbanas12 жыл бұрын
I have that tutorial in the works along with Spring, Hibernate and much more. I'll see what I can sneak in while I make my Android / Games / C tutorial. Thanks for the compliments :)
@derekbanas11 жыл бұрын
Yes I should do an eclipse shortcut video. I try to avoid doing them only because I can never count on people seeing past tutorials. I try to make self contained videos whenever possible.
@ozgunozankilic8 жыл бұрын
I have a very different educational background and I had serious doubts when I took the software design patterns course last semester. Your videos really helped me to understand design patterns and pass the course. Thanks a lot.
@derekbanas8 жыл бұрын
I'm very happy I could be of help :)
@ozgunozankilic6 жыл бұрын
@@derekbanas Update in 2018: I am now assigned as the TA of the course. Better re-watch these.
@hurricanos1312 жыл бұрын
Very nice tutorial, this is ever the best video tutorial covering such confusing subject for software developers.
@derekbanas11 жыл бұрын
If you made it all the way to the design patterns tutorials youre ready for Android. The only thing that seems to confuse people is the heavy use of the MVC pattern. If you're comfortable with that you shouldn't have any problems. Feel free to ask me questions
@derekbanas11 жыл бұрын
Yes you are correct.
@sharathkumar987611 жыл бұрын
Hi Derek! Thank you so much. I cannot tell you how much your tutorials have helped me :)
@derekbanas12 жыл бұрын
You're very welcome as always :)
@StrangerSaret5 жыл бұрын
This video deserves like even for Colleagues classes names))
@smuralimohan111 жыл бұрын
Hi Derek, a thing about shortcuts. In eclipse, the getter/setter methods and constructor can be created in a single click by placing the mouse inside the class body, right-click->source->Generate Getters and Setters and right-click->source->Generate Constructor using fields. I am sure you must be aware of those, but if included in your videos, other viewers too can learn.
@riteshk98799 жыл бұрын
need a simpler example
@ashrasmun17 жыл бұрын
There are two guys and they talk with mediator only. They can give stuff to him or get stuff from him. I cannot imagine a simpler example.
@PENDANTturnips7 жыл бұрын
I cant tell if im stupid but I get lost in a lot of this guys videos.
@Noname03247 жыл бұрын
Same here, I found his videos explains very little in the big picture and ideas, instead he just jumps into a lot of coding after the first 20 seconds or so.
@hexrcs26416 жыл бұрын
It feels like a server-clients pattern...
@hexrcs26416 жыл бұрын
Wait, feels like a mediator is like the bittorrent tracker and the colleagues are the peers
@bryantkong464210 жыл бұрын
hey,teacher Derek. I have finished all your design pattern tutorials today, it is really helpful.
@derekbanas10 жыл бұрын
siyi Kong Thank you :) I'm very happy that I could help.
@derekbanas12 жыл бұрын
Thank you :) I very much appreciate that
@herp_derpingson12 жыл бұрын
Many of these Design Patterns are so similar that its easy to get confused :)
@sunmustbedestroyed10 жыл бұрын
I have watched SooooOoo many of your videos now that "Well, hello internet!" and "please leave any questions or comments in the comments' section below: otherwise till next time." are now firmly ingrained in the speech centers of my brain (a bit like ghosting/retention of a menu on a plasma TV screen). I love it though!
@derekbanas10 жыл бұрын
John Thank you :) Many more videos are coming.
@usmansbk3 жыл бұрын
I see Mediator patter as basically dependency inversion principle
@Floyd-df2uq19 күн бұрын
Spot on. I was thinking the same thing.
@noherczeg8 жыл бұрын
I'm so grateful for your channel! It's a really nice thing to see someone use examples outside of the bullshit todo app stuff.
@derekbanas8 жыл бұрын
You're very welcome :)
@jamiemarshall82847 жыл бұрын
In this pattern - wouldn't you need to make your Mediator a singleton? BTW - love these. It's like tutorials for programmers.
@tonyzhao9049 жыл бұрын
The video is awesome. I only spot one missing line of code in the video, which is: in "Colleague.java", the constructor doesn't have: mediator.addColleague(this); This would cause the collegecode number never reaches 2 or even 1 as shown in the results. But code in the given link is correct. Thanks again for the tutorial.
@subhashkonda50007 жыл бұрын
Whats the use of colleguecode, seems to know who is the source but i haven't seen it is used. Basically how it will stop notifying the source.
@hexrcs26416 жыл бұрын
Why do you remove all the @override annotations?
@derekbanas12 жыл бұрын
Sometimes I do things the long way to collect my thoughts. Its hard for me to talk and type at the same time sometimes :)
@galtfilin25809 жыл бұрын
סרטון מעולה! תודה רבה על העזרה! great video! you helped me a lot... thank you so much!
@derekbanas9 жыл бұрын
+gal tfilin You're very welcome :)
@glebsamsonov76967 жыл бұрын
Very cool tutorial series. Don't know if somebody's already mentioned it but in this one you use reference comparison for strings and that only works because you use string literals like String s = "GOOG" so that same string object is taken from the string pool and reused. Otherwise for strings you should always use equals method.
@123japanuser12 жыл бұрын
Sincere gratitude to you Sir. No medals for me ...a sorry fourth
@xipity7 жыл бұрын
Dude.. Seriously... Is there a "donate" button or something... I admire you!
@derekbanas7 жыл бұрын
Thank you very much :) There is no need to donate. If you don't mind turning off AdBlock, if you use it, I'd appreciate that. Otherwise it is my pleasure to help.
@sharathkumar987611 жыл бұрын
Hi, is the mediator pattern particularly used to tackle objects that have many-to-many relationships?
@pankajtiwari1210 жыл бұрын
Great presentation !
@derekbanas10 жыл бұрын
Thank you :)
@elysiafilm62154 жыл бұрын
This is an awesome explanation! Thank you, very helpful :)
@derekbanas4 жыл бұрын
Thank you :) Happy I could help
@aloneirew11 жыл бұрын
Hey Derek, Love your videos and the way you teach those stuff, i've almost seen all you design pattern videos and im planning to start the UML next, thanks a lot for your time!. Btw - why do you remove the @override annotation sometimes?..seems like a bad practice..
@anjana8529 жыл бұрын
Thank you! these videos are great !
@derekbanas9 жыл бұрын
+anjana852 Thank you :) You're very welcome
@eubor853910 жыл бұрын
Just a question. Why did you removed "@Override" annotations?
@pharoah3275 жыл бұрын
They aren't actually necessary. They are just there to give the compiler a hint as to the fact that you are trying to override a super class' (or an interface) method. If, for example, you spell the method name wrong or give it the wrong signature/header, the compiler will complain. Without @Override, if you make a mistake in the signature, the compiler will just think it is a new method and not give you any errors/warnings. So the @Override is just a safety in case you make a mistake.
@pushkarajpatil47878 жыл бұрын
Hello Derek, Thank you very much for this video, I have a question about this (mediator) design pattern, what is the role of colleague code while transaction is going on. I don's see any use apart from the print, is it really required?
@laststandingdeplorablemgto36377 жыл бұрын
Thanks for the vid. How is synchronization involved in this when Colleagues work in parallel? You need then synchronized methods in the Mediator, either on its entire class or on its internal resources if it is possible to get a more granular ie faster synchronization.
@laststandingdeplorablemgto36377 жыл бұрын
In your example you would probably synchronize upon Mediator.class because sell buy collections are interdependent of each other.
@UCBCteam12 жыл бұрын
Hello Derek.... very nice videos I have learnet alot from your videos.. espacially, both java and design patterns... just wondering if you could give us some tutorials on JSP and Servlets... a bit advance level... thanks
@Arsene013 Жыл бұрын
10 years old but still relevant
@derekbanas12 жыл бұрын
Almost SawMan :)
@jovcemalakovski91485 жыл бұрын
Nice tutorial Derek, useful even today after 8 years. But what I've noticed is that you never used the addColleague method on the mediator and you got correct result in the console output. I was following the example in c# and got wrong colleagues codes, which makes sense because the add method was never used.
@mohammedhasan9468 жыл бұрын
you gave me great help thank you
@derekbanas8 жыл бұрын
You're very welcome :)
@amirkobliansky40229 жыл бұрын
great video! helped me a lot. tank you:)
@derekbanas9 жыл бұрын
Amir Kobliansky Thank you :) I'm glad it helped
@sayedthebacktracker8 жыл бұрын
hi.. Thank you for the video.. I have learned a lot.. Just a quick question.. I am desiging a protocol..which design pattern I can use for following scenerio? From my pc , I send request every milliseconds to another hardware.. then hardware send me response and I send acknowledgement for that request and do necessary task.. It is all about sending request and response.. It would be great help for me if you can give me some idea how to maintain it.. I am using Java RxTx API for serial communication.. Sorry for long message.. Thank you in advance
@keent3 жыл бұрын
I know this is a 8 year old video but this still might find useful for someone. If you managed to got it to the end, you might wonder why your colleague code is `undefined` and found out that the video doesn’t show where to use the `addColleague` method. Here’s my simple solution (using JS Typescript btw): put this code `this.mediator.addColleague(this); ` inside your `Colleague` constructor. hope it helps :)
@CyrilViXP7 жыл бұрын
It's really hard to find the case, when Mediator pattern can't be implemented as Observer
@johnlock84969 жыл бұрын
great tutorial
@derekbanas9 жыл бұрын
john lock Thank you :)
@smuralimohan111 жыл бұрын
Which pairs of design patterns do you find similar/confusing? Could you please post your question so it gives us a chance to think about their nuances and get a better understanding of their applicability?
@derekbanas12 жыл бұрын
You guys are funny :)
@akshay2883 жыл бұрын
Derek Bansa seems to working for Ibank or providing service to ibanks
@farazshah56513 жыл бұрын
Awesome!!!
@herp_derpingson12 жыл бұрын
You are the man Saw Man! XD
@monicajanethsalasrodriguez628710 жыл бұрын
#Hola Buena explicación.
@derekbanas10 жыл бұрын
Mónica Janeth Salas Rodríguez Gracias :)
@rickmonarch45526 жыл бұрын
Could u make a chat program with this? :D
@bigworldmemes5 жыл бұрын
yes, that's actually how chat programs work, you send data to the server, server sends it to the colleague that you specify, most chat programs aren't peer-to-peer
@bigworldmemes5 жыл бұрын
server in this context is the mediator
@bigworldmemes5 жыл бұрын
one might argue though, that with chat rooms you are communicating between 2 OBJECTS of the same type, not 2 CLASSES
@CaponordRevHappy7 жыл бұрын
Simple, now that's explained!
@derekbanas7 жыл бұрын
Thank you :)
@AlphaMatt10004 жыл бұрын
Ridiculously overcomplicated to demonstrate this pattern, and I have 25 years experience building software professionally for many large organizations.
@MrChingy55555 жыл бұрын
for some reason this looks alot like the observer pattern
@AlexEttelis12 жыл бұрын
Did you know you can double click a word to select it? no need to select char by char :D
@ziv45458 жыл бұрын
what is GOF? 1
@derekbanas8 жыл бұрын
This is the Gang of Four book amzn.to/2by0iZf
@fancyjohn8 жыл бұрын
Like a dispatcher with event emitting/subscription
@faithnassiwa8 жыл бұрын
Hi Derek! Great videos, they helped me understand better patterns i had failed to click. Do you have any video tutorials on:- 1. Data access Object (DAO) 2. Transfer Object pattern 3. Java Connector Architecture (JCA) 4. Service Starter Pattern 5. Payload Extractor Pattern ???
@derekbanas8 жыл бұрын
+faith nassiwa Thank you :) Sorry I don't. I hope to cover them soon.
@StormCraftable7 жыл бұрын
String comparrison with == ? o.O
@zss1234567894 жыл бұрын
It's kind of funny because the nyse is the actual broker.
@OverG8812 жыл бұрын
Ok.
@Vendettaaaa66610 жыл бұрын
this is exact opposite of observer pattern.
@minaamir26483 жыл бұрын
example is used to explain the idea , now we need to explain the example .. !! need a simple example as airport
@MusicalSawMen12 жыл бұрын
Second !!!!!!!!!!!!!!!!!!!!!!!!!
@Tomas9705065 жыл бұрын
Your coding examples sometimes are far to much to explain people what you want to explain.
@expertreviews11126 жыл бұрын
wow i understood NOTHING! The example took me to moon and back.
@Brainsucker924 жыл бұрын
I had a massive cringe when I saw the string comparison via the "==" operator...
@iforgot6694 жыл бұрын
But in many languages this is how you do do string comparisons and design patterns are language agnostic. Even if that's syntactically wrong in the case of Java i think it removes clutter for anyone coming from a different language. Not saying it was intentional, but I just don't see it as a problem for the use case of this video.
@Brainsucker924 жыл бұрын
@@iforgot669 It's not syntactically wrong but fuctionally wrong. The "==" operator simply does not do what your're trying to achieve in this context.
@iforgot6694 жыл бұрын
@@Brainsucker92 So your saying it's the wrong syntax for comparison; as in, syntactically wrong. I didnt say it wouldn't compile.
@Brainsucker924 жыл бұрын
@@iforgot669 No, I'm saying it's the wrong functionality for comparison...