CS 4402-01 Learning Journal Unit 6
CS 4402-01 Learning Journal Unit 6
This week, I worked on a discussion assignment focused on two key concepts in object-oriented
programming (OOP): Generics and Open Recursion. To complete the assignment, I conducted
research using both online sources and academic materials. I started by reading articles and
documentation on generics and open recursion to understand their definitions, importance, and
practical applications. I also referred to books such as Effective Java by Joshua Bloch and
Design Patterns by Gamma et al. to gather deeper insights into how these concepts are
To provide concrete examples, I wrote sample code in Kotlin to demonstrate the use of generics
and open recursion. For generics, I created a Box<T> class that could store and return any type
of value, showcasing how generics improve type safety and code reusability. For open recursion,
I implemented a Base and Derived class, where the Derived class overrides a method in the Base
class, demonstrating how polymorphism works through open recursion. After completing my
research and coding examples, I structured my discussion post by defining each concept,
explaining its significance, and presenting the code examples with in-text citations.
My Reactions
I found the process of understanding generics straightforward since I had previously worked with
similar concepts in Java. However, open recursion was more challenging because it required a
how the parent class could allow a subclass to override a method in a recursive call without
breaking the structure of the program. Once I grasped the concept through examples, it became
more intuitive. Writing code in Kotlin was satisfying because the language’s concise syntax
I received valuable feedback from my classmates after posting my discussion. One of them
pointed out that my example on generics could be improved by adding more complex use cases,
such as using generics with collections. This feedback helped me to reflect on the flexibility of
generics and how they can simplify working with data structures. Another classmate asked for
clarification on how the self reference works in open recursion, which led to an interesting
exchange where I had to revisit the concept and explain it more clearly. This interaction
At first, I felt frustrated when working through the concept of open recursion because it wasn’t
immediately clear how it differed from standard recursion. However, after reviewing examples
and reading more about dynamic binding and polymorphism, I felt more confident. I was excited
when my code worked as expected, especially when I managed to implement both generics and
open recursion without syntax errors. Overall, I felt more engaged with the topic because it
What I Learned
From this assignment, I gained a stronger understanding of how generics and open recursion
contribute to the flexibility and power of OOP. I learned that generics improve type safety and
code reusability by allowing code to handle different data types without type casting. I also
learned that open recursion enables dynamic behavior at runtime, allowing subclasses to modify
inherited methods while preserving the structure of the parent class. This deepened my
What surprised me was how generics can simplify code when working with collections and
complex data structures. The challenging part was understanding how open recursion relies on
the self reference and why it’s different from regular recursion. I realized that I’m becoming
more comfortable with Kotlin, which reflects my growing confidence as a programmer. This
assignment reinforced the importance of understanding core OOP principles, as they are essential
Application of Concepts
I can see myself applying generics in future projects involving data processing or machine
learning, where working with different data types is common. Open recursion could be useful in
adjusted at runtime. Understanding these concepts will make me more effective in solving
One important takeaway is the importance of mastering OOP fundamentals like generics and
open recursion. These concepts are not just theoretical—they have practical applications in
building efficient and scalable software. This assignment has motivated me to explore more