1 00:00:00,970 --> 00:00:07,000 Let's start from the root of the hierarchical tree structure, so we have the worker interface here 2 00:00:07,000 --> 00:00:11,610 that has only a method that will be implemented into leaf objects. 3 00:00:11,920 --> 00:00:17,130 And we also have to leave objects, the human and the robot, both are kind of the same. 4 00:00:17,740 --> 00:00:21,460 They have two properties, only the name and department. 5 00:00:22,270 --> 00:00:29,200 We have the implementation of the preferred method with a single outline just for the sake of simplicity. 6 00:00:29,680 --> 00:00:35,470 We have getters and setters for each property and a two string method that will be used in the main 7 00:00:35,470 --> 00:00:41,620 method to output the name and the department of each robot and human worker. 8 00:00:42,250 --> 00:00:46,030 We also have the composite class and here it is. 9 00:00:46,030 --> 00:00:56,230 It implements the worker and has the methods for dealing with adding and removing workers such as human 10 00:00:56,230 --> 00:00:57,640 and robot employees. 11 00:00:58,120 --> 00:01:07,600 And also it has the two string method that we see here which outputs the names or and the departments 12 00:01:07,600 --> 00:01:11,390 of all the human and robot employees. 13 00:01:11,650 --> 00:01:13,690 So let's see the main method here. 14 00:01:13,720 --> 00:01:22,180 So basically we create a human and a robot with a name and department and also a work manager that will 15 00:01:22,180 --> 00:01:27,130 add the human and the robots in the corresponding lists. 16 00:01:27,310 --> 00:01:32,920 And also the CSA will output the all the things that are contained in that list. 17 00:01:32,930 --> 00:01:34,500 So let's see this in action. 18 00:01:35,020 --> 00:01:42,760 Let's run this main method so we can see that the human workers are and we get the name the two string 19 00:01:42,760 --> 00:01:51,820 implementation of the human class and the robot workers are this one two string representation of the 20 00:01:51,820 --> 00:01:52,620 robot class. 21 00:01:53,260 --> 00:01:53,770 That's it. 22 00:01:53,770 --> 00:01:55,660 Four for the composite pattern. 23 00:01:56,050 --> 00:01:59,890 And join me in the next video where we are going to discuss about decorator's. 24 00:02:00,160 --> 00:02:01,870 So see you in the next tutorial.