User:Jeroen De Dauw/Single Responsibility Principle/01

From semantic-mediawiki.org

The single responsibility principle

class MapsLocation {

    protected $latitude;
    protected $longitude;
    // ...

    protected $address;
    protected $isValid;

    protected $icon;
    protected $group;
    // ...

    protected $format;
    protected $directional;
    // ...

    public function setCoordinates( $coordinates ) {
        // parse
    }

    public function setAddress( $address, $asActualLocation = true ) {
        // geocode
    }

    public function __construct( $coordsOrAddress = null, $format = Maps_COORDS_FLOAT, $directional = false, $separator = ',' ) {
        // ...
    }

    // ...

}