title
Composite Design Pattern Practical

description
Recommended Book : Head First Design Pattern : http://amzn.to/2pY5xbR This video contains practical session. Composite design pattern belongs to Structural design pattern which belongs to Design Patterns in java. Composite design patten allows you to have a tree structure and ask each node in the tree structure to perform a task. Trainer: Navin Reddy Check out our website: http://www.telusko.com Follow Telusko on Twitter: https://twitter.com/navinreddy20 Follow on Facebook: Telusko : https://www.facebook.com/teluskolearnings Navin Reddy : https://www.facebook.com/navintelusko Follow Navin Reddy on Instagram: https://www.instagram.com/navinreddy20 Subscribe to our other channel: Navin Reddy : https://www.youtube.com/channel/UCxmkk8bMSOF-UBF43z-pdGQ?sub_confirmation=1 Telusko Hindi : https://www.youtube.com/channel/UCitzw4ROeTVGRRLnCPws-cw?sub_confirmation=1 Subscribe to the channel and learn Programming in easy way. Java Tutorial for Beginners : https://goo.gl/p10QfB Scala Tutorials for Java Developers : https://goo.gl/8H1aE5 C Tutorial Playlist : https://goo.gl/8v92pu Android Tutorial for Beginners Playlist : https://goo.gl/MzlIUJ XML Tutorial : https://goo.gl/Eo79do Design Patterns in Java : https://goo.gl/Kd2MWE Java Servlet : https://goo.gl/R5nHp8 Hibernate Tutorial :https://goo.gl/N5ONYg Spring MVC Tutorial : https://goo.gl/9ubbG2 OpenShift Tutorial for Beginners : https://goo.gl/s58BQH Spring Framework with Maven : https://goo.gl/MaEluO Sql Tutorial for Beginners : https://goo.gl/x3PrTg String Handling in Java : https://goo.gl/zUdPwa Array in Java : https://goo.gl/uXTaUy Socket Programming in Java : https://goo.gl/jlMEbg Exception Handling in Java : https://goo.gl/N4NbAW Regards, Navin Reddy

detail
{'title': 'Composite Design Pattern Practical', 'heatmap': [{'end': 352.893, 'start': 332.742, 'weight': 0.701}, {'end': 594.289, 'start': 501.799, 'weight': 0.716}], 'summary': 'Discusses the composite design pattern, explaining its use in creating object structures like a tree, hierarchical structure of computer components, and implementation in java to create a computer system with the ability to add, remove, and display prices of individual components.', 'chapters': [{'end': 35.84, 'segs': [{'end': 45.308, 'src': 'embed', 'start': 18.306, 'weight': 0, 'content': [{'end': 22.428, 'text': 'so that this code will make more sense, because we will be focusing more on the practical aspect here.', 'start': 18.306, 'duration': 4.122}, {'end': 24.891, 'text': 'but just to give a quick introduction.', 'start': 23.41, 'duration': 1.481}, {'end': 26.853, 'text': 'what exactly composite design pattern is?', 'start': 24.891, 'duration': 1.962}, {'end': 33.458, 'text': "so composite design pattern is used to create a structure of an object where, example, let's say, let's say,", 'start': 26.853, 'duration': 6.605}, {'end': 35.84, 'text': 'if you want to achieve a tree structure here.', 'start': 33.458, 'duration': 2.382}, {'end': 42.026, 'text': "example, let's say when you buy a new computer or whenever you want to assemble a computer.", 'start': 35.84, 'duration': 6.186}, {'end': 45.308, 'text': 'In a computer we have lots of components right?', 'start': 42.686, 'duration': 2.622}], 'summary': 'Composite design pattern creates object structures, e.g., for computer components.', 'duration': 27.002, 'max_score': 18.306, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF418306.jpg'}], 'start': 0.799, 'title': 'Composite design pattern', 'summary': 'Discusses the composite design pattern, a structural design pattern used to create object structures like a tree.', 'chapters': [{'end': 35.84, 'start': 0.799, 'title': 'Composite design pattern', 'summary': 'Discusses the composite design pattern, a part of the structural design pattern, which is used to create a structure of an object, for example, a tree structure.', 'duration': 35.041, 'highlights': ['Composite design pattern is a part of structural design pattern and is used to create a structure of an object, for example, a tree structure.', 'The practical aspect of composite design pattern is emphasized, and it is recommended to watch the theory video first for better understanding.']}], 'duration': 35.041, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4799.jpg', 'highlights': ['Composite design pattern is a part of structural design pattern and is used to create a structure of an object, for example, a tree structure.', 'The practical aspect of composite design pattern is emphasized, and it is recommended to watch the theory video first for better understanding.']}, {'end': 634.391, 'segs': [{'end': 87.557, 'src': 'embed', 'start': 58.339, 'weight': 0, 'content': [{'end': 64.084, 'text': 'And then when I talk about cabinet, inside cabinet, we have some more components, right? We have motherboard, we have hard drive.', 'start': 58.339, 'duration': 5.745}, {'end': 71.448, 'text': 'But inside a hard drive also, in fact motherboard also we have two things, we have RAM and we have CPU.', 'start': 64.763, 'duration': 6.685}, {'end': 78.852, 'text': 'So, when you have this structure, when you have this hierarchy, that if you want to talk about RAM, it is inside a computer,', 'start': 71.848, 'duration': 7.004}, {'end': 82.554, 'text': 'inside the computer we have specifically inside your cabinet.', 'start': 78.852, 'duration': 3.702}, {'end': 87.557, 'text': 'inside your cabinet is specifically on your motherboard and inside motherboard you have RAM.', 'start': 82.554, 'duration': 5.003}], 'summary': 'Computer components hierarchy: cabinet → motherboard → ram', 'duration': 29.218, 'max_score': 58.339, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF458339.jpg'}, {'end': 142.212, 'src': 'embed', 'start': 116.713, 'weight': 1, 'content': [{'end': 123.2, 'text': 'which I mean another file, which is computer part, which has two classes one is leaf and second is composite.', 'start': 116.713, 'duration': 6.487}, {'end': 132.546, 'text': "So what I'll be having inside leaf, example of leaf would be hard drive, it would be RAM, CPU and all those things.", 'start': 123.8, 'duration': 8.746}, {'end': 136.008, 'text': "We're not going for all the objects inside a computer but some of them.", 'start': 133.166, 'duration': 2.842}, {'end': 139.451, 'text': 'So, to achieve this, what we need here is we need.', 'start': 136.889, 'duration': 2.562}, {'end': 142.212, 'text': 'so the main thing is here.', 'start': 139.451, 'duration': 2.761}], 'summary': 'The file contains two classes: leaf and composite for computer parts like hard drive, ram, and cpu.', 'duration': 25.499, 'max_score': 116.713, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4116713.jpg'}, {'end': 208.379, 'src': 'embed', 'start': 182.581, 'weight': 2, 'content': [{'end': 187.884, 'text': 'so I will say I will get an interface here so that we will get some common thing between this two.', 'start': 182.581, 'duration': 5.303}, {'end': 189.846, 'text': "so we'll say this is component.", 'start': 187.884, 'duration': 1.962}, {'end': 195.59, 'text': "so I'm creating a interface called as component inside this interface I want.", 'start': 189.846, 'duration': 5.744}, {'end': 203.996, 'text': "so both these classes need to have a common method which is public void, show price, because I'm focused, I'm more concerned about the price here.", 'start': 195.59, 'duration': 8.406}, {'end': 208.379, 'text': "in fact, when you talk about the interface we don't have to create, we don't have to assign the modifier there.", 'start': 203.996, 'duration': 4.383}], 'summary': "Creating a common interface 'component' with method 'show price' for two classes.", 'duration': 25.798, 'max_score': 182.581, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4182581.jpg'}, {'end': 355.034, 'src': 'heatmap', 'start': 316.821, 'weight': 3, 'content': [{'end': 317.841, 'text': 'I just want name.', 'start': 316.821, 'duration': 1.02}, {'end': 319.463, 'text': 'here I will say name.', 'start': 317.841, 'duration': 1.622}, {'end': 321.464, 'text': "let's see what else we need later.", 'start': 319.463, 'duration': 2.001}, {'end': 323.406, 'text': 'okay, so we have to create components here, right.', 'start': 321.464, 'duration': 1.942}, {'end': 327.829, 'text': "so I will say new, add a list, because that's what we want.", 'start': 323.406, 'duration': 4.423}, {'end': 330.821, 'text': "we want to create a list of objects, and that's it.", 'start': 327.829, 'duration': 2.992}, {'end': 332.742, 'text': 'we got the at least here.', 'start': 330.821, 'duration': 1.921}, {'end': 339.746, 'text': 'so this composite, this composite, should be able to add the component and it should be able to remove the component if you want.', 'start': 332.742, 'duration': 7.004}, {'end': 342.848, 'text': 'but time bin will only say how to add the component.', 'start': 339.746, 'duration': 3.102}, {'end': 343.408, 'text': 'so what i will do?', 'start': 342.848, 'duration': 0.56}, {'end': 344.268, 'text': 'i will say public.', 'start': 343.408, 'duration': 0.86}, {'end': 352.893, 'text': 'i will say public void, add component, which will, which will be able to add the component, whichever we want, and to add the component.', 'start': 344.268, 'duration': 8.625}, {'end': 355.034, 'text': 'what i will do here is i will pass an object.', 'start': 352.893, 'duration': 2.141}], 'summary': 'Creating a composite to add and remove components for a list of objects.', 'duration': 38.213, 'max_score': 316.821, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4316821.jpg'}, {'end': 601.112, 'src': 'heatmap', 'start': 486.164, 'weight': 5, 'content': [{'end': 488.867, 'text': 'again, you, we can use normal for loop or we can use an else for loop.', 'start': 486.164, 'duration': 2.703}, {'end': 489.547, 'text': "that's your choice.", 'start': 488.867, 'duration': 0.68}, {'end': 491.53, 'text': "Let's print the value now.", 'start': 490.629, 'duration': 0.901}, {'end': 493.111, 'text': 'Now, how can you print the price?', 'start': 492.07, 'duration': 1.041}, {'end': 496.414, 'text': "It's very simple just simply say c.showPrice.", 'start': 493.171, 'duration': 3.243}, {'end': 499.937, 'text': 'because when you say showPrice, we are so okay.', 'start': 496.414, 'duration': 3.523}, {'end': 501.358, 'text': 'now this is tricky, okay.', 'start': 499.937, 'duration': 1.421}, {'end': 508.685, 'text': "Now, since I'm not specifying leaf or composite, I'm saying component, the component, object.showPrice.", 'start': 501.799, 'duration': 6.886}, {'end': 512.268, 'text': 'now the component which we are getting, which we are adding in the components.', 'start': 508.685, 'duration': 3.583}, {'end': 517.832, 'text': "if, let's say, the first component is composite, the second component is composite, the third one is leaf.", 'start': 512.268, 'duration': 5.564}, {'end': 520.054, 'text': 'what will happen for the third one?', 'start': 518.613, 'duration': 1.441}, {'end': 521.854, 'text': 'it is simply print the price right.', 'start': 520.054, 'duration': 1.8}, {'end': 527.717, 'text': "so let's say, if you're going for the third component here, which is actually a leaf, it will print the price.", 'start': 521.854, 'duration': 5.863}, {'end': 535.299, 'text': "but let's say the first one second one, which is your composite, what it will do is for that composite, it will again call the leaf nodes,", 'start': 527.717, 'duration': 7.582}, {'end': 535.96, 'text': 'so it will go.', 'start': 535.299, 'duration': 0.661}, {'end': 537.02, 'text': 'it will traverse.', 'start': 535.96, 'duration': 1.06}, {'end': 539.721, 'text': 'okay, from composite composite leaf.', 'start': 537.02, 'duration': 2.701}, {'end': 543.302, 'text': "okay, let's do that, let's print this so that you will get the idea there.", 'start': 539.721, 'duration': 3.581}, {'end': 548.773, 'text': 'But then we are using these two variables right?', 'start': 546.291, 'duration': 2.482}, {'end': 552.036, 'text': 'How do you assign these two values, price and name?', 'start': 548.813, 'duration': 3.223}, {'end': 553.037, 'text': 'And what about this name?', 'start': 552.096, 'duration': 0.941}, {'end': 558.341, 'text': 'For that, what I will do is I will use a constructor to assign the value.', 'start': 553.657, 'duration': 4.684}, {'end': 565.167, 'text': "So I will say source and we'll say constructor which can take two variables and we are done with that.", 'start': 558.361, 'duration': 6.806}, {'end': 567.649, 'text': "Okay, so we've got a constructor which can take two values.", 'start': 565.287, 'duration': 2.362}, {'end': 573.474, 'text': 'And then in the composite as well, to assign this value name, I will use a constructor.', 'start': 568.85, 'duration': 4.624}, {'end': 583.516, 'text': "so I will say write like and we'll say source constructor, okay, with name, no, I don't need components there, just name.", 'start': 574.386, 'duration': 9.13}, {'end': 584.798, 'text': 'okay, we got the constructor as well.', 'start': 583.516, 'duration': 1.282}, {'end': 585.639, 'text': "now why I'm doing that?", 'start': 584.798, 'duration': 0.841}, {'end': 589.163, 'text': 'because when I want to create the object, I can assign the value there itself.', 'start': 585.639, 'duration': 3.524}, {'end': 589.984, 'text': "let's start with the first one.", 'start': 589.163, 'duration': 0.821}, {'end': 594.289, 'text': "Now, when you say let's create this hierarchy, we have a computer.", 'start': 591.328, 'duration': 2.961}, {'end': 601.112, 'text': 'computer will have two parts cabinet and peripheral cabinet will have hard drive and motherboard.', 'start': 594.289, 'duration': 6.823}], 'summary': 'Discusses creating a hierarchical structure using components and constructors, and printing the price based on component type.', 'duration': 114.948, 'max_score': 486.164, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4486164.jpg'}, {'end': 552.036, 'src': 'embed', 'start': 527.717, 'weight': 4, 'content': [{'end': 535.299, 'text': "but let's say the first one second one, which is your composite, what it will do is for that composite, it will again call the leaf nodes,", 'start': 527.717, 'duration': 7.582}, {'end': 535.96, 'text': 'so it will go.', 'start': 535.299, 'duration': 0.661}, {'end': 537.02, 'text': 'it will traverse.', 'start': 535.96, 'duration': 1.06}, {'end': 539.721, 'text': 'okay, from composite composite leaf.', 'start': 537.02, 'duration': 2.701}, {'end': 543.302, 'text': "okay, let's do that, let's print this so that you will get the idea there.", 'start': 539.721, 'duration': 3.581}, {'end': 548.773, 'text': 'But then we are using these two variables right?', 'start': 546.291, 'duration': 2.482}, {'end': 552.036, 'text': 'How do you assign these two values, price and name?', 'start': 548.813, 'duration': 3.223}], 'summary': 'Discussion on traversing composite nodes and assigning values to variables.', 'duration': 24.319, 'max_score': 527.717, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4527717.jpg'}], 'start': 35.84, 'title': 'Composite objects and design pattern', 'summary': 'Discusses the hierarchical structure of computer components, categorizing them into composite objects and leaf nodes, with specific costs assigned to leaf objects such as ram and keyboard. it also explains the implementation of composite design pattern to create a structure of leaf and composite objects, with a common interface, allowing the addition and removal of components, and the ability to show the price of individual components within a composite object.', 'chapters': [{'end': 162.894, 'start': 35.84, 'title': 'Composite objects in computer components', 'summary': 'Discusses the hierarchical structure of computer components, categorizing them into composite objects and leaf nodes, with specific costs assigned to leaf objects such as ram and keyboard.', 'duration': 127.054, 'highlights': ['The chapter discusses the hierarchical structure of computer components It explains the hierarchy of computer components, including cabinets, peripheral devices, motherboard, hard drive, RAM, and CPU.', 'Categorizing components into composite objects and leaf nodes It categorizes components such as cabinet and peripheral devices as composite objects, while hard drive is labeled as a leaf node due to the absence of internal components.', 'Specific costs assigned to leaf objects such as RAM and keyboard It mentions specific costs for leaf objects, stating that RAM costs around 2000 rupees and a keyboard costs around 500 rupees.']}, {'end': 634.391, 'start': 163.334, 'title': 'Composite design pattern', 'summary': 'Explains the implementation of composite design pattern to create a structure of leaf and composite objects, with a common interface, allowing the addition and removal of components, and the ability to show the price of individual components within a composite object.', 'duration': 471.057, 'highlights': ["The creation of a common interface called 'component' for both the leaf and composite classes, ensuring the presence of a common method 'showPrice', facilitating the implementation of composite design pattern. The chapter emphasizes the need for a common interface 'component' shared by both leaf and composite classes, ensuring the presence of the method 'showPrice' for implementation.", "The implementation of the 'addComponent' method in the composite class to add components and the use of a list to store the components, enabling the creation of composite objects with multiple components. The chapter elaborates on the implementation of the 'addComponent' method in the composite class, allowing the addition of components to create composite objects with multiple components stored in a list.", 'The utilization of a constructor to assign values such as price and name to the leaf and composite objects, enabling the creation of objects with assigned values. The usage of a constructor to assign values such as price and name to the leaf and composite objects is highlighted, facilitating the creation of objects with pre-assigned values.', "The iteration through the components of a composite object using a for loop to show the price of each individual component, demonstrating the functionality of the 'showPrice' method within the composite structure. The chapter showcases the iteration through components of a composite object using a for loop to display the price of each individual component, demonstrating the functionality of the 'showPrice' method within the composite structure."]}], 'duration': 598.551, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF435840.jpg', 'highlights': ['The chapter discusses the hierarchical structure of computer components, including cabinets, peripheral devices, motherboard, hard drive, RAM, and CPU.', 'Categorizing components into composite objects and leaf nodes, with specific costs assigned to leaf objects such as RAM and keyboard.', "The creation of a common interface called 'component' for both the leaf and composite classes, ensuring the presence of a common method 'showPrice', facilitating the implementation of composite design pattern.", "The implementation of the 'addComponent' method in the composite class to add components and the use of a list to store the components, enabling the creation of composite objects with multiple components.", 'The utilization of a constructor to assign values such as price and name to the leaf and composite objects, enabling the creation of objects with assigned values.', "The iteration through the components of a composite object using a for loop to show the price of each individual component, demonstrating the functionality of the 'showPrice' method within the composite structure."]}, {'end': 1023.466, 'segs': [{'end': 772.138, 'src': 'embed', 'start': 750.161, 'weight': 1, 'content': [{'end': 759.093, 'text': 'because ultimately we need a computer right and then this would be cabinet right and then this would be motherboard, MB, and this would be a computer.', 'start': 750.161, 'duration': 8.932}, {'end': 759.933, 'text': "so we'll say computer.", 'start': 759.093, 'duration': 0.84}, {'end': 763.855, 'text': 'now, once we got five objects and then once we got five components,', 'start': 759.933, 'duration': 3.922}, {'end': 770.938, 'text': "once we got five name here I mean five composite objects let's add this composite object right now.", 'start': 763.855, 'duration': 7.083}, {'end': 772.138, 'text': 'how do we add this composite object?', 'start': 770.938, 'duration': 1.2}], 'summary': 'Discussion about assembling five computer components.', 'duration': 21.977, 'max_score': 750.161, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4750161.jpg'}, {'end': 882.088, 'src': 'embed', 'start': 854.24, 'weight': 0, 'content': [{'end': 858.424, 'text': "so we'll say mb.addComponent and we'll say RAM.", 'start': 854.24, 'duration': 4.184}, {'end': 859.665, 'text': 'so we are adding RAM.', 'start': 858.424, 'duration': 1.241}, {'end': 861.407, 'text': 'we are adding CPU and RAM in motherboard.', 'start': 859.665, 'duration': 1.742}, {'end': 866.812, 'text': 'then we are adding motherboard and hard drive inside cabinet and then we are adding mouse monitor inside peripheral right,', 'start': 861.407, 'duration': 5.405}, {'end': 868.354, 'text': 'we are adding lots of components.', 'start': 866.812, 'duration': 1.542}, {'end': 871.979, 'text': "I know I can feel now I'm actually building a computer here.", 'start': 869.477, 'duration': 2.502}, {'end': 877.104, 'text': "I'm assembling a computer and then we have to add peripheral and the cabinet inside your computer, right.", 'start': 871.979, 'duration': 5.125}, {'end': 882.088, 'text': "so we'll say computer, which is computer, which is computer here and then say add component.", 'start': 877.104, 'duration': 4.984}], 'summary': 'Assembling a computer with cpu, ram, motherboard, and peripherals.', 'duration': 27.848, 'max_score': 854.24, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4854240.jpg'}, {'end': 1003.5, 'src': 'embed', 'start': 952.446, 'weight': 3, 'content': [{'end': 956.128, 'text': 'so inside peripheral we have mouse and monitor, which cost 508, 000.', 'start': 952.446, 'duration': 3.682}, {'end': 963.992, 'text': 'so the amazing thing about composite is you can use the same operation on leaf object or even composite object.', 'start': 956.128, 'duration': 7.864}, {'end': 965.633, 'text': 'if it is leaf object, it will print the value.', 'start': 963.992, 'duration': 1.641}, {'end': 968.635, 'text': 'if it is composite, it will print all the values of the leaf objects.', 'start': 965.633, 'duration': 3.002}, {'end': 977.541, 'text': 'Now, amazing thing is, if I say computer here, which is the top of the hierarchy, if I say computer.showPrice, you can see it will print everything.', 'start': 969.275, 'duration': 8.266}, {'end': 980.723, 'text': 'It will print, first of all it will print computer, inside computer we have peripheral.', 'start': 977.581, 'duration': 3.142}, {'end': 988.929, 'text': 'Peripheral is printing these two objects and then cabinet is printing the cabinet values, which is MB, and motherboard, which is a part of cabinet,', 'start': 981.444, 'duration': 7.485}, {'end': 990.17, 'text': 'and then it is printing that as well.', 'start': 988.929, 'duration': 1.241}, {'end': 994.073, 'text': "It's so awesome, right? So that is how your composite design pattern works.", 'start': 990.671, 'duration': 3.402}, {'end': 1003.5, 'text': 'So, just to give you a quick glimpse, we have, we have an interface, which is component, and then we have two classes leave and we have composite.', 'start': 994.613, 'duration': 8.887}], 'summary': 'Composite design pattern allows uniform operation on leaf and composite objects, demonstrating total cost of peripherals at 508,000.', 'duration': 51.054, 'max_score': 952.446, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4952446.jpg'}], 'start': 634.391, 'title': 'Creating composite objects and the composite design pattern in java', 'summary': 'Covers the process of creating composite objects in java, including specifying parameters, creating leaf and composite objects, and adding components to the composite objects, ultimately building a computer system. it also explains the composite design pattern using an example of printing prices of computer components, demonstrating how the pattern works with leaf and composite objects and showing the hierarchy of objects and their prices.', 'chapters': [{'end': 906.227, 'start': 634.391, 'title': 'Creating composite objects in java', 'summary': 'Covers the process of creating composite objects in java, including specifying parameters, creating leaf and composite objects, and adding components to the composite objects, ultimately building a computer system.', 'duration': 271.836, 'highlights': ['The process of creating leaf and composite objects in Java, including specifying parameters such as name and price for the leaf objects.', 'The step-by-step process of adding components to the composite objects, such as adding peripheral devices, cabinet, and motherboard, ultimately assembling a computer system.', 'The importance of correctly adding components to the composite objects, ensuring the hierarchy and structure of the computer system is maintained.', 'The demonstration of assembling a computer system by adding leaf and composite objects, showcasing the practical application of creating composite objects in Java.']}, {'end': 1023.466, 'start': 906.227, 'title': 'Composite design pattern', 'summary': 'Explains the composite design pattern using an example of printing prices of computer components, demonstrating how the pattern works with leaf and composite objects and showing the hierarchy of objects and their prices.', 'duration': 117.239, 'highlights': ['The composite design pattern allows the same operation to be used on leaf and composite objects, where leaf objects print their value and composite objects print the values of their leaf objects, providing a flexible and reusable structure for handling complex hierarchies of objects.', "The chapter demonstrates the Composite Design Pattern using an example of printing prices of computer components, showcasing the hierarchy of objects and their respective prices, such as RAM, mouse, monitor, and CPU, with quantifiable values like RAM's price being 3000 and the total cost of peripheral being 8000.", "The chapter concludes by highlighting the structure of the Composite Design Pattern, which involves an interface 'component' and two classes 'leaf' and 'composite' that implement 'component', ensuring that common operations can be performed on both leaf and composite objects, providing a clear understanding of the pattern's implementation."]}], 'duration': 389.075, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Q1jZ4TI6MF4/pics/Q1jZ4TI6MF4634391.jpg', 'highlights': ['The step-by-step process of adding components to the composite objects, such as adding peripheral devices, cabinet, and motherboard, ultimately assembling a computer system.', 'The demonstration of assembling a computer system by adding leaf and composite objects, showcasing the practical application of creating composite objects in Java.', 'The importance of correctly adding components to the composite objects, ensuring the hierarchy and structure of the computer system is maintained.', 'The process of creating leaf and composite objects in Java, including specifying parameters such as name and price for the leaf objects.', 'The composite design pattern allows the same operation to be used on leaf and composite objects, where leaf objects print their value and composite objects print the values of their leaf objects, providing a flexible and reusable structure for handling complex hierarchies of objects.', "The chapter demonstrates the Composite Design Pattern using an example of printing prices of computer components, showcasing the hierarchy of objects and their respective prices, such as RAM, mouse, monitor, and CPU, with quantifiable values like RAM's price being 3000 and the total cost of peripheral being 8000.", "The chapter concludes by highlighting the structure of the Composite Design Pattern, which involves an interface 'component' and two classes 'leaf' and 'composite' that implement 'component', ensuring that common operations can be performed on both leaf and composite objects, providing a clear understanding of the pattern's implementation."]}], 'highlights': ["The chapter demonstrates the Composite Design Pattern using an example of printing prices of computer components, showcasing the hierarchy of objects and their respective prices, such as RAM, mouse, monitor, and CPU, with quantifiable values like RAM's price being 3000 and the total cost of peripheral being 8000.", 'The composite design pattern allows the same operation to be used on leaf and composite objects, where leaf objects print their value and composite objects print the values of their leaf objects, providing a flexible and reusable structure for handling complex hierarchies of objects.', 'The step-by-step process of adding components to the composite objects, such as adding peripheral devices, cabinet, and motherboard, ultimately assembling a computer system.', 'The practical aspect of composite design pattern is emphasized, and it is recommended to watch the theory video first for better understanding.', 'The chapter discusses the hierarchical structure of computer components, including cabinets, peripheral devices, motherboard, hard drive, RAM, and CPU.']}