vendredi 27 octobre 2017

Design my classes

I am learning design patterns and wanted to apply it to my classes in java. In my app, department is interface, there are different departments and have responsibility. Here is my class definitions

public interface department {
    public void responsibility();
}

public class MathsDept implements department {
    @override
    public void responsibility() {
    // have own my implementation.
    }
}

public class EnglishDept implements department {
    @override
    public void responsibility() {
    // have own my implementation.
    }
}

Now, these departments have their expenses, so management decided to give money on daily and monthly basis to run the department activities.

How to apply design patterns to such requirement, what design pattern will fit here.

  • Thanks in advance

Aucun commentaire:

Enregistrer un commentaire