Tag: refactor

  1. Visitor Design Pattern in Java

    In this post we are going to talk about Visitor Pattern in Object Oriented Programming. What is Visitor Pattern? In a simple sentence, Visitor Design Pattern is used when you trying to seperate your algorithm from the object. Why? Sometimes you want to add new features without changing the object…

    on design pattern oop object oriented programming refactor cleanc code programming php solid

  2. Composite Design Pattern in Java

    In this post we are going to talk about another structural design pattern - Composite Design Pattern. What the heck is Composite Design Pattern? Here are some definition that I think is really helpful, at least for me, to understand what Composite Design Pattern is. link link link Highly recommend…

    on design pattern java object oriented programming oop cleanc code programming refactor

  3. Setter and Getter are evil!

    In this post we are going to talk about why getter and setter are bad and how to solve it. What is Getter & Setter? Getter & Setter are how you use to modify fields in your class. Let's have a look at the following example. package com.oop; class…

    on oop solid object oriented programming design pattern programming refactor

  4. Factory Pattern

    In this post, we are going to talk about how to use Factory Design Pattern in PHP. What is Factory Pattern and Why? Using Factory design pattern can hide the instantiation logic and defer it to subclasses. Although it might look a bit too much to write at the beginning…

    on oop php object oriented programming design pattern programming refactor solid

  5. Loose Coupling in PHP

    In this post, we are going to talk about what is Loose Coupling in PHP. What is Loose Coupling? Here is a rather great article if you want to understand more about what is Loose Coupling. Have you ever experienced the situation that a change of a class influence the…

    on php oop refactor object oriented programming solid

  6. Command/Query Segregation in PHP

    This is gonna be a short post regarding the command query segregation in object oriented programming. What is Command/Query Segregation? It means that a method is either a command performing an action, or a query that returns data, but not both. Being purely action-performing methods, commands always have a…

    on php object oriented programming oop cqrs refactor cleanc code

  7. Write Better OOP Code in PHP

    I happened to read one post that I found to be so useful to me and I want to share some opinions of the article. You can find the link here. It is about how to write a maintainable code in an object oriented way that can embrace changes. Why…

    on php object oriented programming oop design pattern refactor

  8. Refactoring Conditional Expressions

    In this post we are going to talk about how to refactor your Conditional Expressions in PHP. What is Conditional Expressions? Just like the above diagram that Conditional Expressions performs different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false. <?php $a = 1;…

    on php object oriented programming oop design pattern refactor