I am developing a php application using MVC architecture and i really need suggestions about the following design guidelines:
According to php class structure best practises, its noted that someone should minimize module dependencies, my application class inheritance is as followed:
- some operations/methods are accessible by all classes
- what i have done is i have created an HelperClass which will contain all these "global" methods like string manipulations, integer manipulations, array manipulations and then let the other classes which would like to use these methods extend the class.
Class organization:
interface StringHelper{
...
}
interface ArrayHelper{
...
}
class GeneralHelper implements StringHelper, ArrayHelper{
......
}
class NewClass extends GeneralHelper{
...
}
// user factory style to create object
class NewClassFactory{
public function create( $options ){
return new NewClass( $options );
}
}
The application has about 15 classes.
Is this approach suitable for this scenario or will i end up having big issues when maintaining my application? Would appreciate for your help.