ArticleslgStudy

computer science

Service abstraction

Service abstraction is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Service abstraction rather than just read about it. In short: Service abstraction is a design principle that is applied within the service-orientation design paradigm so that the information published in a service contract is limited to what is required to effectively utilize the service The service contract should not contain any superfluous information that is not required for its invocation. Also that the information should be limited to the serviced contract (technical con…

Key takeaways

  • Service abstraction belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Service abstraction to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Service abstraction from memory before moving on to harder problems.

Reference excerpt

Service abstraction is a design principle that is applied within the service-orientation design paradigm so that the information published in a service contract is limited to what is required to effectively utilize the service The service contract should not contain any superfluous information that is not required for its invocation. Also that the information should be limited to the serviced contract (technical contract and the service level agreement) only, no other document or medium should be made available to the service consumers other than the service contract that contains additional service related information.

Purpose A service contract that contains details about what it encapsulates (e.g., the logic, implementation and the technology used to build the service) may end up being used in a particular manner by providing the service consumer more knowledge about the working of the service. In the case of service-orientation, more knowledge is not necessarily better. There is a chance that additional information could impede the reusability of the service as the service consumer designer may streamline his design based on this knowledge. However, doing so would affect the evolution of the service contract as now the service consumer is indirectly coupled to the service implementation, which may need to be replaced in the future. This increases the consumer-to-contract type of coupling, which is a positive type of coupling. However, having too much dependence can negatively impact the evolution of both the service provider and the service consumer. Information hiding remains one of the key principles within object-oriented paradigm that promotes abstracting away the inner workings of a software program. A classic example would be the use of abstract classes to hide the actual method logic. The same concept is applied by the service abstraction principle in order to hide the unnecessary details about the working of the service with a view to ease the evolution of the service.

Application The application of this design principle requires looking into four different types of abstractions that could be applied to a service.

Functional abstraction This form of abstraction is dependent upon how much of the service logic is exposed as service capabilities. An example would be of a class whereby some of its methods are private while others are public. A class would only expose those methods as public that it deems to be important to its objects, any helper methods that are not relevant to the objects are kept hidden. A service contract which has not been subjected to this principle could be termed as a 'detailed contract' that reveals much of business rules and the validation logic. Once this principle has been applied to a fair degree, the contract could be termed as a ‘concise contract’. Further application of this design principle would result in a 'optimized contract' that maximizes the reuse potential of the service.

Technology information abstraction Any information about the underlying technology used within the service would result in a low technology information abstraction as the service contract explicitly tells the service consumers how the service logic and its implementation are designed. This extra information might result in service consumers being designed in a way that specifically targets that particular implementation, thereby developing consumer-to-implementation coupling.

Logic abstraction The programmatic details about the service logic need to be abstracted as knowledge about how the service actually performs its functionality can result in service consumers that factor in this information and are consequently designed under these assumptions. This can seriously hamper service logic refactoring efforts and can be considered as an anti-pattern towards the application of the service refactoring design pattern.

Quality abstraction Quality abstraction relates to the details provided within the service’s accompanying service level agreement. It is important to concentrate only on that kind of information that would actually help in determining the reliability and availability of the service, no other information should be included that exposes unnecessary details e.g. details about how does a service sit within the overall business process and which other services it uses for fulfilling its functionality. The level of access control applied to a service would decide how much of technology, logic and quality of service abstractions are in place. An 'open access' would provide free access to everyone that is interested in finding out the design specifications of a service. In a 'controlled access', only authorized people are granted access and a 'no access' policy would totally deny any access to the design documents.

Considerations Although information hiding is considered a healthy practice, however, too much of information hiding could be counter productive as it can limit the re-usability level of the service. This can also result in redundant services as service designers don’t have enough information about the capabilities of the service. For this, each service contract needs to be designed in a concise yet comprehensive manner so that the service’s capabilities can be effectively discovered and interpreted as dictated by the service discoverability principle. The kind of information exposed in the service contract can lead to some security related concerns as well. for example, a service that propagates the details about the database in use as result of an internal error can fall a victim to an attack where the attacker makes use of the reported error details and attempts to connect to the database. This could be addressed by the application of the message screening and exception shielding design patterns.

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Service abstraction

Start with the simplest possible case. Write down what Service abstraction claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Service abstraction before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Service abstraction ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Service abstraction

In research
Service abstraction appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Service abstraction in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Service abstraction is common in secondary-school and first-year university syllabi. It links to neighbouring topics Service-oriented (business computing), so understanding it makes those chapters shorter.
In everyday life
Look for Service abstraction outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Service abstraction” →

How to study Service abstraction in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Service abstraction means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Service abstraction out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Service abstraction in simple terms?

Service abstraction is a design principle that is applied within the service-orientation design paradigm so that the information published in a service contract is limited to what is required to effectively utilize the service The service contract should not contain any superfluous information that…

Why does Service abstraction matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Service abstraction?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Service abstraction.

Tags

  • Service-oriented (business computing)

Keep exploring