UST-MICO / mico

A Management System for Microservice Compositions
Apache License 2.0
8 stars 3 forks source link

Ensure consistent usage of the "service" terminology #548

Closed davidkopp closed 5 years ago

davidkopp commented 5 years ago

As a developer it is crucial to have a clear and unambiguous understanding of the terms that are used escpecially regarding the term "service". Unfortunately the term "service" is overloaded and its meaning takes on different shades depending on the context.

In MICO we have to differentiate between at least 3 different meanings:

Furthermore we have to consider the terminology of a service in the context of the Spring Framework and how DDD could be applied in Spring based web applications. In DDD the Controller is considered to be part of the UI layer. The Spring Framework annotation type Service relates to the definition of a Domain Service. The official documentation also mentions, that a class annotated with @Service is a "Business Service Facade" (in the Core J2EE patterns sense).

In issue #537 it was suggested to use the Java EE Pattern Boundary-Control-Entity Pattern that uses different terms like Broker (instead of Service) and Resource (instead of Controller). The renaming was introduced in PR #538. Unfortunately it was already merged into master.

Tasks:


My proposal regarding the package naming is to use the terms of Spring and DDD and not use the Boundary-Control-Entity Pattern. For example the introduced term ServiceBroker is also be misleading. The Open Service Broker API specifies a Service Broker as a component that is "responsible for advertising a catalog of service offerings and service plans to the marketplace, and acting on requests from the marketplace for provisioning, binding, unbinding, and deprovisioning" (quoted by Open Service Broker API).

Therefore revert the changes made by PR #538 to go back to the terms Service and Controller to stick to the Spring naming conventions. If we want to have a Domain Service for the entity MicoService we could use the naming MicoServiceDomainService. Sounds ugly, but I think it would be clear. I'm open for better naming options.

Nevertheless it is important to never say just Service. Depending on the current context, use e.g. MICO Service, Kubernetes Service or Domain Service.

spethso commented 5 years ago

In accordance with the PO, there was a refactoring from service to broker