听课笔记:Advanced Distributed Systems Design Chapter 7
Introduction to SOA(Service Oriented Architecture)
WHAT IS A SERVICE? A service is the technical authority for a specific business capability. All data and business rules reside within the service. Nothing is “left over” after identifying services Everything must be in some service. The key words of a service is encapsulation and business capability. It is self contained, and takes certain business responsibility by itself.
Tenets of Service Orientation: 1. Services are autonomous. 2. Services have explicit boundaries 3. Services share contract & schema, not class or type 4. Service interaction is controlled by policy.

Service boundaries should not be defined by layers, or systems, but business responsibility.

A UI page may not be owned by any service. Instead, each service has a component/widget that takes care of a part of the page.

There could be common elements in a page like color scheme, layout, fonts, CSS, images, etc that are not owned by any of the component services. Such elements all communicate the “corporate brand”; hence is the responsibility of the “branding” service. Each service binds its model to part of the view model in the branding layout.
In SOA, the below workflow is not owned by any service; each service owns part of the workflow.

Instead of building a giant parent object Order which references its children buy their ID, SOA prefers to build the structure with reversed reference. Each object within a service keeps a reference to the parent object by order ID. In this way, there is no need to construct and manage a central large object of Order, which would cause high coupling.

Finally, technical stuff like Authentication, Authorization, is put in the IT/Operation service. It is responsible for keeping information flowing (and secure) in the enterprise. Its focus is on the deployment & physical views: Responsible for hosting (web servers, DBs, etc) Owns connection strings, queue names.It doesn’t really do pub/sub with other services.

The IT/Ops service works like a broker. However it does not talk to other services by remote calls, but by in-process invocation through packeges and interfaces. Consider it as an infrustructure that handles lower level work like logging.