open in the way that we work with and collaborate with others in the industry, in how we listen to customers, and in our approach to the cloud. We contribute to and partner with open source communities and promote interoperability to make it easier and less costly for customers to develop and manage mixed IT environments. We actively participate in the standards setting process and support established and emerging standards in our products. In the cloud, we support key standards that provide the building blocks for open, interoperable cloud services, and we support developer choice of programming languages. We support data portability and believe customers own and control their data, no matter where it resides.
new HtmlEntititesDecorator($client); $client = new ParagraphDecorator($client); ! // Later in your code, and possibly in multiple places print $client->getData();
argument the // name of the class to produce public static function getInstance($driver) { // Attempt to include the the file containing the class // (not necessary if you use a custom autoloader) if(include_once(dirname(__FILE__).'/drivers/database_'. $driver.'.php')) { // Build the name of the class, instantiate, and return $driver_class = 'Database_'.$driver; return new $driver_class; } else { throw new Exception('Database driver not found'); } } } ! // To use, call the factory's static method: $db = DatabaseFactory::getInstance('MySQL');
single instance of the class private static $instance; ! // The constructor is private so that outside code cannot instantiate private function __construct() { } ! // All code that needs to get and instance of the class should call // this function like so: $db = Database::getInstance(); public function getInstance() { // If there is no instance, create one if (!isset(self::$instance)) { $c = __CLASS__; self::$instance = new $c; } return self::$instance; } // Block the clone method private function __clone() {} } ! // To use, call the static method to get the only instance $db = Database::getInstance();
in seconds Public: Proxies & browsers can cache Private: Only browsers can cache No-cache: Revalidate before dropping from cache No-store: don’t cache at all Must-revalidate: Browser revalidate before serving from cache Proxy-revalidate: Browser revalidate before serving from cache
a hierarchy, so you know that something with additional slashes is a subordinate resource ✓Verbs are used to perform operations on resources ✓The operation is implicit and not part of the URL ✓A hypermedia format is used to represent the data ✓Link relations are used to navigate a service