Naming Pattern
Sponsored by

Services are most commonly named in a verb-noun pattern, such as “calculateMortgage” or “send-message.” This is a bit different from standard object oriented naming conventions, which often have method names that are just verbs. This is because, in OO, you are typically telling an object to do something: “mortgage, calculate yourself” or “message, send yourself”. Distributed services, though, are fundamentally different.

Objects rarely stand in isolation, but are usually deeply dependent on other objects. While this is a powerful paradigm, it doesn’t lend itself to being distributed over wide area networks or the Internet.

Also, the naming pattern may indicate the usage of an underlying design or architectural pattern. A method called do(command) is probably following the command pattern – a powerful pattern that allows the requestor to create very complex requests at runtime.

Services, on the other hand, are generally meant to be used either individually or collectively across networks that may have substantial lag, and their interfaces are much more course grained than objects.

Another point to be made about service naming patterns is that they can indicate subtle design tradeoffs. For instance, “updateName(Name)” indicates a more course grained interface than a pair of methods “updateFirstName(FirstName)” and “updateLastName(LastName).”


Home | Table of Contents | More Info |