Man these videos are great. They are perfect. I've been looking everywhere for explanations for some of these design patterns and not a single person could explain them the way you did. Cheers!
Currently covering this topic in my Data Structures class, and this was such a helpful explanation of a confusing chapter. Seeing everything visualized really helped me grasp the concept. Much appreciated!
Yo that's actually insane. I am having a test next week in creational/ structural/ behaviour design patterns. How am I even supposed to remember all this. I am watching this video which are really nice and they explain really well but idk all of them at the same time to be examined. :/
I believe watching these two videos will help clarify the concept: th-cam.com/video/Vfk6sExu8-4/w-d-xo.html & th-cam.com/video/sN2_CoB_kbw/w-d-xo.html Cheers!
It implements it and not extends it! Feel free to check our OOP basics video here: th-cam.com/video/Vfk6sExu8-4/w-d-xo.html for more info :) You could name the interface anything you want, but in this series our main focus is explaining the patterns and why and when to use each of them! Cheers!
Great video! "class Product implements Box" sounds a bit off. I think renaming the "Box" interface to "PriceGettable" and "CompositeBox" to just "Box" makes more sense. // Nodes public interface PriceGettable { double calculatePrice(); } // Non-leaf nodes public class Box implements PriceCalculatable { private final List boxesOrProducts; @Override public double calculatePrice() { return boxesOrProducts.stream() .mapToDouble(PriceCalculatable::calculatePrice) .sum(); } } // Leaf nodes abstract class Product implements PriceCalculatable { final String title; final String price; } public class Book extends Product { @Override public double calculatePrice() { return getPrice(); } } public class Book extends Product { @Override public double calculatePrice() { return getPrice(); } }
Now I can skip 3 hours of class going over this and completely understand it in 5 minutes! Good freaking job!
Man these videos are great. They are perfect. I've been looking everywhere for explanations for some of these design patterns and not a single person could explain them the way you did. Cheers!
Wow! Glad you like them :) Thanks a lot
Your videos definitely provide a starting point in understanding clearly what a certain design pattern is.
This is great.
Currently covering this topic in my Data Structures class, and this was such a helpful explanation of a confusing chapter. Seeing everything visualized really helped me grasp the concept. Much appreciated!
You're very welcome! Glad it was helpful :)
Fantastic example and explanation
Well explained
Thank you for this series. It's been very helpful!
I have to say that your videos are so helpful. Thank you very much
Glad you like them!
Thank you so much, u're saving me in the night of an exam ❤️❤️❤️
That's exactly why am here
it is really helped me alot! thank you very very much !
Thanks, great job!
Yo that's actually insane. I am having a test next week in creational/ structural/ behaviour design patterns. How am I even supposed to remember all this. I am watching this video which are really nice and they explain really well but idk all of them at the same time to be examined. :/
Good luck with your test! Let us know if we can help you further :)
@@geekific thanks for the support !!
Very helpful indeed. IAre composite pattern and composition (meaning composition instead of regular inheritance in java ) the same concept?
I believe watching these two videos will help clarify the concept: th-cam.com/video/Vfk6sExu8-4/w-d-xo.html & th-cam.com/video/sN2_CoB_kbw/w-d-xo.html Cheers!
4:25 The UML diagram is missing the has-a relationship from Composite class to Component internface.
that's right
thanks
Thanks,
what a good video
Thank you!
When you have a Book that is a Box (extending the Product : Box class) - you are confused.
It implements it and not extends it! Feel free to check our OOP basics video here: th-cam.com/video/Vfk6sExu8-4/w-d-xo.html for more info :) You could name the interface anything you want, but in this series our main focus is explaining the patterns and why and when to use each of them! Cheers!
What is the difference between Composite and Decorator?
Please check the Decorator video here: th-cam.com/video/v6tpISNjHf8/w-d-xo.html
Great video! "class Product implements Box" sounds a bit off. I think renaming the "Box" interface to "PriceGettable" and "CompositeBox" to just "Box" makes more sense.
// Nodes
public interface PriceGettable {
double calculatePrice();
}
// Non-leaf nodes
public class Box implements PriceCalculatable {
private final List boxesOrProducts;
@Override
public double calculatePrice() {
return boxesOrProducts.stream()
.mapToDouble(PriceCalculatable::calculatePrice)
.sum();
}
}
// Leaf nodes
abstract class Product implements PriceCalculatable {
final String title;
final String price;
}
public class Book extends Product {
@Override
public double calculatePrice() {
return getPrice();
}
}
public class Book extends Product {
@Override
public double calculatePrice() {
return getPrice();
}
}
Thanks for the effort and feedback :)