I am developing an image editor app so which approach is better for class design from mentioned below? Any one of three or any new?
First
class Image{
string path
rotateLeft(){};
rotateRight(){};
changeBrightness(){};
}
or Second
class Image{
string path
}
Image image = new Image();
Class Editor{
rotateLeft(Image image){}
rotateRight(Image image){}
changeBrightness(Image image){}
}
or Third
Interface Operation{
rotateLeft(Image image);
rotateRight(Image image);
changeBrightness(Image image);
}
class Image Implements Operation{
string path;
rotateLeft(this){}
rotateRight(this){}
changeBrightness(this){}
}
please discuss pros and cons for both approach.