-
Notifications
You must be signed in to change notification settings - Fork 248
Notes for SDK Developers
gecampbell edited this page Feb 12, 2013
·
6 revisions
- Most objects are a subclass of
PersistentObject. Before you add new code to handle a specific object, think about whether or not that code can be made reusable for other objects. If so, it should probably go in thePersistentObjectclass. - Most objects are associated with a Service. The Service can be considered
the object's parent.
PersistentObjectprovides two methods:Service()andParent(). These are synonyms by default. In some cases, however, the parent of an object is not a service, but another object type. For example, the parent ofVolumeAttachmentis aServer, not a service. In these cases, the__construct()method of the child class should save the parent object and override theParent()method to return it as opposed to theService(). To continue with theVolumeAttachmentexample, using theService()to construct a URL results in an incorrect Url. - If you submit a code change, you should also submit unit tests. Unit tests
use the PHPUnit test framework and are stored under the
tests/directory.