Save this video free

[HD] EECS4302 F26 - 2026-10-08 (Thursdsay) - Lecture 9

Jackie Wang · 1:16:59 · Watch on YouTube

Part of York University EECS3342/EECS4302. See all 36 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

EECS4302 Lecture 9 develops the Composite pattern in Java through four design attempts, showing how to prevent invalid operations, eliminate duplicated collection code with generics, and handle Java’s restriction against extending multiple classes. It traces recursive price calculation using polymorphism and dynamic binding, then introduces the Visitor pattern through expression-tree operations and the cohesion, single-choice, and open-closed principles.

Key takeaways

Chapters

0:00 UML Arrows: Inheritance and Client–Supplier Relationships
7:00 Selecting Design Diagrams for Reports and Exam Practice
13:00 Composite Attempt 1: Recursive Equipment and the Invalid Add Method
19:00 Composite Attempt 2: Restricting Children to Composite Equipment
22:00 Attempt 2’s Code Duplication Across Recursive Systems
27:00 Attempt 3: Generics Meet Java’s Single-Class Inheritance Rule
31:00 The Diamond Problem and Ambiguous Inherited Methods
36:30 Final Composite Design: Generic Abstract Class Plus Equipment Interface
41:30 Uniform Price Access for Base and Composite Equipment
49:00 Dynamic Binding Selects Recursive or Base Price Calculation
54:00 Building and Tracing a Cabinet Equipment Tree
1:00:00 Visitor Motivation: Operations on an Expression Tree
1:03:00 Why Putting Every Expression Operation in Every Node Scales Poorly
1:08:00 Cohesion and the Single-Choice Principle
1:13:00 Open–Closed Choices for Expression Structure and Operations

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:05 you will see some diagram notation in the design diagram. Okay. So, typically the red well of course in the actual uh exam on the paper you may not see the color right. So you got to pay more attention right. If you see the arrow like this usually arranged in the vertical way right like arrow and with the empty arrow head right here. So these typically mean inheritance. So we are saying that this drive is a class that extends equipment. Okay. And also for example here we say cabinet extends composite equipment. Okay that's what we meant. So whenever you see vertical arrows with the empty heads over here that means inheritance. And if you see abstract over here that means abstract class. If you see interface over here of course it means interface right? So

0:52 these are you can see all the correspondence in Java. But there's one more thing I want to talk about. Whenever you see any arrow they kind of arrange horizontally it means something a little bit different. Okay, that's something I want to talk about since you didn't uh not every one of you study uh uh software design before this course. But it's a very basic concept which will be easy to understand. So whenever you see green arrow it represents uh okay let me just say okay something like this right with a solid uh arrow head like that okay something like that okay rather than empty it's something called client supplier relationship client supplier relation

1:42 Basically whenever you got any attribute decoration you basically have some supplier you also have some clients but let's see exactly how to understand that let's say for example I have a class called students okay over here and you can think about

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jackie Wang.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.