Last Week at Tong Hin

The past week , I have been trying to make all the integration tests pass in the project .

20 weeks have passed since I’ve written my first blog .

Since day 1 , I have learned countless of new techniques to manage a project . Of course , the skills that I possessed today came with numerous embarrassing experiences . A few “highlights” I could think of is me committing my first commit message as “commit” , manually inserting 400-500 lines of required rows in SQL for not adding the latest migration , not to mention unique rows . Also , spending 6 hours a day trying to build the project because one number in the port was set incorrectly . I am sharing this because as embarrassing as it can be , even at its very peak , always remind ourselves mistakes are not something we should shy away from but to embrace and learn from it .

In all honesty , big thanks to my supervisor Peter who is persistent in putting me under this forceful environment at all times , as much as I hate it , I am also equally grateful for it . Accelerating my learning curve and more importantly , realizing results come from sheer hard work , not living in our own comfort zones to feel good about our own opinions .

Also , I would like to thank everyone else who ensured my time at Tong Hin was smooth and memorable .

Thank you once again .

Object-Oriented Programming

Throughout my coding experience in Tong Hin’s module . I have applied most of the concepts in Object Oriented Programming (OOP) . OOP is a concept of using classes and objects . The classes in OOP are usually referred to as “blue prints” which means the structure of the program , we are able to use these classes to form objects which contains data . The 4 basics concepts of OOP are Encapsulation , Inheritance , Polymorphism and Abstraction .

Encapsulation controls the display and access of methods with public , private and protected modifiers , each with its own unique purpose . These access can also be control by a getter and setter method . A getter method is used to get the changes of a value of a property . A setter method is used to set or update a value of a property . I have used this concept a lot while creating new features with the wrapper pattern implementation .

Inheritance allows us to access methods from other classes with the : symbol . This concept has helped me a lot with achieving less messy and maintainable code with inheriting repository interfaces and database contexts when creating unit tests .

Polymorphism can be broke down into 2 types , static (method overloading) and dynamic (method overriding) . Method overloading allows us to use multiple methods with the same name , under the conditions of declaring different data types , changing the order or number of parameters . Method overriding allows us to use the virtual keyword within a base class method , I have used this a lot to with the creation/disposing of the test databases .

Abstraction is rarely used among the 4 concepts . However the purpose of an abstract class is to hide certain details and showing only essential information .

After getting the hang of these concepts , I could not imagine developing a project without the practice of OOP , while recognizing more and more new ways of problem solving and reducing code complexity .

CI/CD

The past week , I read about the practice of CI/CD (Continuous Integration , Continuous Delivery) in a developing project . For newer developers , the biggest fear is doing a pull request and recognizing the countless of red underlines in our code , while it’s already a mess to develop a single branch without causing breaking changes , we can’t imagine the stress having to pull requests from multiple branches .

Continuous Integration (CI)

A solution to this problem is a to practice CI . As the goal is to have multiple developers working simultaneously on different features . It is very likely to cause changes that breaks the application . Therefore , a successful CI involves creating well-designed unit and integration tests across all modules , so that code changes can be regularly tested , built and merged to a shared repository without breaking the application in the CD stage .

Continuous Delivery (CD)

A CD picks up where the CI ends , CD automates the release of that validated code to a repository. In order to have a successful CD process , it’s essential that CI is already built into your development pipeline . The goal of CD is to have a codebase that is ready to be delivered from a SandBox environment within minutes of creation to a production environment.