0% found this document useful (0 votes)
24 views4 pages

CS 4402-01 Learning Journal Unit 6

This week, I focused on a discussion assignment about generics and open recursion in object-oriented programming, conducting research and writing sample code in Kotlin to illustrate these concepts. While I found generics straightforward, open recursion posed challenges that deepened my understanding of polymorphism. Feedback from classmates enhanced my insights, and I recognized the practical applications of these concepts in future programming projects.

Uploaded by

prinxkhay100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

CS 4402-01 Learning Journal Unit 6

This week, I focused on a discussion assignment about generics and open recursion in object-oriented programming, conducting research and writing sample code in Kotlin to illustrate these concepts. While I found generics straightforward, open recursion posed challenges that deepened my understanding of polymorphism. Feedback from classmates enhanced my insights, and I recognized the practical applications of these concepts in future programming projects.

Uploaded by

prinxkhay100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

What I Did

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

implemented in real-world programming.

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

deeper understanding of polymorphism and dynamic binding. Initially, I struggled to understand

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

made it easier to implement and test the concepts.

Feedback and Interactions

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

deepened my understanding and helped me refine my explanation.

Feelings and Attitudes

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

involved practical coding rather than just theoretical study.

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

understanding of polymorphism and the principles of object-oriented design.

Challenges and Realizations

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

for writing scalable and maintainable code.

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

designing flexible frameworks or libraries where subclass behavior needs to be dynamically

adjusted at runtime. Understanding these concepts will make me more effective in solving

complex programming challenges.


Key Takeaway

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

advanced OOP patterns and to refine my coding skills further.

Word Count: 580 words

You might also like