๐งญ Topic: OOP Review
Quick Overview :
This topic reviews core OOP concepts including encapsulation, inheritance, polymorphism, and abstraction through practical exercises. It also introduces Generics in Java and covers optional topics like HTML, CSS, and web scraping fundamentals.
๐ Covered in This Topic
OOP Concepts Review
- Encapsulation: Private fields with public getters/setters; data hiding and protection
- Inheritance: Creating class hierarchies (e.g.,
StudentandTeacherextendUser) - Polymorphism: Different user types responding to the same method calls
- Abstraction: Abstract classes (like
User) defining common behavior
Introduction to Generics
- Generic classes and methods for type-safe code
- Using parameterized types with collections (
ArrayList<T>) - Benefits: Compile-time type checking, code reusability
- Common generic types:
List<T>,Map<K,V>,Optional<T>
HTML & CSS (Optional Study Topic)
- HTML fundamentals: Tags, attributes, document structure
- CSS basics: Selectors, properties, styling
- Video recordings provided by TAs
- External learning resources recommended
Web Scraping Introduction
- What is web scraping and why itโs valuable
- Applications: Price monitoring, market research, data collection
- Tools: JSoup library for Java
- HTML parsing techniques with JSoup
๐ Slides & Materials
- ๐จโ๐ซ Professor Slides (PDF) (Not available - review session)
- ๐งโ๐ซ TA Workshop Slides (PDF)
- ๐น TA Tutorial Videos: Movies Folder
๐ ๏ธ Workshop & Assignments
๐ฌ Workshop: Hogwarts School System
- ๐ WS-04-oop-review Repository
- Objective: Build a magical school management system applying OOP principles
- Class Hierarchy:
User(abstract) โStudent/Teacher - Practice Concepts: Encapsulation, Inheritance, Polymorphism, Abstraction, Lists & Collections, Input Validation, ID-based Selection
- TODO Sections:
- Student.java (3 TODOs):
enrollInCourse(),showMyCourses(),getEnrolledCourses() - SchoolSystem.java (5 TODOs):
registerStudent(),loginStudent(),findStudent(),addCourseToSystem(),findCourseById() - Main.java (4 TODOs): Registration menu, Login menu, Show my courses, Enroll logic
- Student.java (3 TODOs):
- Note: For practice only - no bonus, complete with TA assistance in class
๐งฎ Assignment: IMDb Scraper (Optional/Bonus)
- ๐ HW-5-IMDB-SCRAPER Repository
- Objective: Parse HTML movie data using JSoup
- Tasks:
- Integrate JSoup dependency (
pom.xml) - Complete
Movieclass design - Parse HTML from
src/main/resources/Movies.html - Extract movie information (title, rating, year)
- Implement sorting algorithms (by title, year, rating)
- Pass JUnit tests (
ParserTest.java) - Visualize results in
Mainclass
- Integrate JSoup dependency (
- Resources: TA tutorial videos, JSoup documentation, HTML/CSS guides
- Evaluation: Functionality, code quality, sorting efficiency, test execution
- Status: Optional with bonus points
๐ Repository Links
| Repository | Description |
|---|---|
| ๐ WS-04-oop-review | Workshop: Hogwarts School System - Practice OOP concepts with a magical theme |
| ๐ HW-5-IMDB-SCRAPER | Assignment: IMDb Scraper (Optional/Bonus) - Practice web scraping with JSoup |
๐ Additional Resources
- Oracle Java Tutorials - Generics
- JSoup Official Website
- JSoup - Javatpoint
- JSoup - Baeldung
- HTML - W3 Schools
- CSS - W3 Schools
โฉ Navigation
Tip :
The Hogwarts workshop is an excellent opportunity to reinforce your understanding of OOP concepts in a fun context. Take time to understand the relationships between classes and how polymorphism works. For the optional web scraping assignment, watch the TA tutorial videos first - theyโll help you understand JSoupโs parsing methods and CSS selectors. Even if you donโt complete it, learning basic web scraping is a valuable skill for future projects!