Cloud Foundry: Design and Architecture
Derek Collison discusses the goals, the design premises and patterns employed in creating the architecture of Cloud Foundry, VMware’s open source PaaS, unveiling internal architectural details.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
How would you like to view the presentation?
One of the reasons peering inside the body causes issues is that it leads to code in your controllers/handlers that looks like this ...
if (body has this)
{
//this stuff
}
else if (body has that)
{
//that stuff
}
else if (body has the other)
{
//the other stuff
}
else if (etc ...
Instead think of separating each of those state checks in separate controllers each referenced by a single URI. For every "if else" you may need another resource. In this way the URI act as a type of router, automatically routing the resource you are changing to the right controller.
A direct side effect of this is easier to understand code, greater decoupling, and in my opinion less bugs created by trying to wrap your minds around all those if statements.
This video is a very good treatment on resource oriented design and Rest.
Impressive.
Seems like the first two examples he presented were just complete BS. Who would write code (and call it a REST service) when it completely violates all principles of REST. No one that has been a programmer for more then three days is going to write an Order "service" that is so course grained that it handles completely different payloads at the same URI/method. The ..\Order\123 GET should get a resource named 123, ..\Order PUT, creates a resource, ..\Order\123 POST should modify the order. Period. There might have been useful information in this talk but I couldn't make it past the premise that a professional developer would write services of this armature nature.
Not if you use an OO design in your service.
In that case, the handler looks up an unmarshaller keyed by the content type of the body, uses the unmarshaller to turn the bitstream of the body into a running object, tells the object to act. and the object does whatever it does.
E.g.
Unmarshaller unmarshaller = unmarshallers.lookUp(request.contentType);
PostAction action = unmarshaller.unmarshall(request.body);
action.performUpon(theActualResource);
I think you got PUT and POST the wrong way around. PUT is idempotent (if I replace the resource twice the end result is the same) whereas POST is unsafe and creates a new resource.... The ..\Order\123 GET should get a resource named 123, ..\Order PUT, creates a resource, ..\Order\123 POST should modify the order. Period. ...
How did you create the request.contentType? How does the lookUp method choose the right marshaller? If there any if-then-else-if statements in any of those?
Derek Collison discusses the goals, the design premises and patterns employed in creating the architecture of Cloud Foundry, VMware’s open source PaaS, unveiling internal architectural details.
Andrew Watson talks about the work of the OMG, where CORBA is alive and well (hint: in your car), UML and UML Profiles vs. custom Modeling languages, DDS and other middleware, and much more.
Sohil Shah discusses creating iPhone and Android enterprise mobile applications based on cloud services using the open source platform OpenMobster.
Paul Sanford presents the transformations supported by data throughout its life cycle, and how that can be better done with Splunk, an engine for monitoring and analyzing machine-generated data.
A common “best practice” for unit tests is to only write a one assertion in each test. I intend to question this advice by showing that multiple assertions per test are both necessary and beneficial.
John Rauser presents the architectural and technological evolution of Amazon retail websites starting with 1994 and ending with adopting Amazon Web Services.
Michael Stal discusses system architecture quality, how to avoid architectural erosion, how to deal with refactoring, and design principles for architecture evolution.
Every developer has had to integrate with another system, API or component. Tis article provides strategies to handle the change and for he separating system boundaries.
5 comments
Watch Thread Reply