none
How Should we think regarding SOLID principle of OOPS while creating classes? RRS feed

  • Question

  • I have a project, my PM says to create classes which follow SOLID principle.


    I have a school having Student, Teacher and many other things to include in the project. So how should i create classes?

    Please suggest me.

    Wednesday, April 13, 2016 11:03 AM

Answers

  • Hi,

    can you be more concrete where your problem is? The SOLID principles are described in short in https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

    If you have problems with one, then you will be able to find much more details online for each. But I am quite sure that your teacher told you about the SOLID principles.

    You just have to go through the principles and make sure that you understood:
    a) how do you see that the principle is broken?
    b) how can you fix that?

    if you understood the principles, then you could simply start:

    Just create your data model and then check your model regarding the principles. So is each class only responsibe for one thing? Or did you mix something up? If you did that, then please divide it up into multiple classes or move stuff where it belongs.

    Or regarding dependency Inversion How are classes dependent on each other? Do you have a super class that is dependend on a child class in any way? 

    With kind regards,

    Konrad

    Wednesday, April 13, 2016 12:50 PM