Generasi Gigih Intermediate Class Reflection — Week 1

Ilham S
2 min readJul 12, 2021

On this occasion, I would like to share the experience of the first week being at the intermediate level in the Generasi Gigih program. The first module is focused to learn more about how object-oriented programming works in ruby. Object-oriented programming is a programming paradigm based on the concept of “objects”. There are 5 concepts learned in the Generasi Gigih program.

The first session in module one explained a lot about abstraction and encapsulation concepts. Abstraction is the concept of object-oriented programming that shows only essential attributes and hides unnecessary information. The main purpose of abstraction is to hide unnecessary details from the user. Abstraction is about choosing the relevant states and behaviors we need to model our objects. The next is encapsulation, which is used as a mechanism to restrict direct access to data objects. But at the same time, it supports access to data through object methods. This way, we can ensure that the data object is hidden from the outside and can only be accessed if we allow it.

Session two in module one explained in deep about inheritance and polymorphism. Inheritance is a concept that allows child class to inherit the attributes and method of the parent class. This provides the ability to create new classes by abstracting out common attributes and behaviors from the parent. Not only that, with inheritance we can do the overriding method. Overriding allows us to rearrange the methods that do not suit the child class behaviors. The second concept is polymorphism, polymorphism is the provision of a single interface to entities of different types. Polymorphism allowing variable, function, or object to take on multiple forms, one function can have more than one behavior with polymorphism.

The last session and personally my hardest lesson so far is composition. We usually heard a lot about inheritance as a ‘kind-of ‘ or ‘is-a’ relationship between classes, composition is known as a ‘has-a ‘ relationship. With composition, we build classes by embedding classes in other classes. The recommended way of doing composition in ruby is with dependency injection. Dependency injection is a programming technique that makes a class independent of its dependencies. It achieves that by decoupling the usage of an object from its creation. However, in a dynamic type language like ruby, we don't have to create an abstract class as we can rely on duck typing instead.

In this one week only, I receive gold value information about object-oriented programming. The live session, exercise, and homework every session really helped me a lot with my understanding of OOP. But our mentor in generasi gigih encouraged us to not stop learning about the concept. Because with routine practice, we can sharpen our skills in one of the most important concepts in programming.

--

--