User:Jeroen De Dauw/Single Responsibility Principle/02

From semantic-mediawiki.org

The single responsibility principle

class MapsLocation {

    // The values representing a geographical location
    protected $latitude;
    protected $longitude;
    // ...

    // Alternatively an "address", which might or might not be "valid"
    protected $address;
    protected $isValid;

    // Information on how the location is used in a map
    protected $icon;
    protected $group;
    // ...

    // Information on how the location should be formatted
    protected $format;
    protected $directional;
    // ...

}
  • Clear violation of SRP