The Composite Pattern Explained and Implemented in Java | Structural Design Patterns | Geekific

preview_player
Показать описание

In this video, we break down, define and implement in Java the Composite Structural Design Pattern.

Timestamps:
00:00 Introduction
00:07 What is the Composite Pattern?
02:28 Composite Pattern Implementation
03:41 The Composite Pattern Class Diagram
04:54 Recap
05:26 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #DesignPatterns #CompositePattern #StructuralPatterns
Рекомендации по теме
Комментарии
Автор

Now I can skip 3 hours of class going over this and completely understand it in 5 minutes! Good freaking job!

fastexpand
Автор

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!

BoonkiCoC
Автор

Your videos definitely provide a starting point in understanding clearly what a certain design pattern is.
This is great.

kineticBoss
Автор

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!

sarabloss
Автор

Thank you for this series. It's been very helpful!

derekdevs
Автор

I have to say that your videos are so helpful. Thank you very much

manalahmadi
Автор

it is really helped me alot! thank you very very much !

mintdu
Автор

Thank you so much, u're saving me in the night of an exam ❤️❤️❤️

AymenTDD
Автор

Very helpful indeed. IAre composite pattern and composition (meaning composition instead of regular inheritance in java ) the same concept?

andresdiaz
Автор

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. :/

seuz
Автор

4:25 The UML diagram is missing the has-a relationship from Composite class to Component internface.

aldolunabueno
Автор

When you have a Book that is a Box (extending the Product : Box class) - you are confused.

dadlord
Автор

What is the difference between Composite and Decorator?

AfriandiHaryanto
Автор

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<PriceCalculatable> boxesOrProducts;

@Override
public double calculatePrice() {
return boxesOrProducts.stream()

.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();
}
}

NBRIUM