August 2017
Beginner
298 pages
7h 26m
English
The sample code implementation is available at 09-module-patterns/02-services. The pattern.two.service module exports the PublicInterface. It doesn't contain any implementation classes of its own:
module pattern.two.service {
exports pattern.two.external;
}
Two implementation modules pattern.two.implA and pattern.two.implB both contain implementations of the service that are declared using provides in the module declaration. Both implementation modules require the service module pattern.two.service to access the interface. Here's how the module definition for one of the implementation modules looks like:
module pattern.two.implA {
requires pattern.two.service;
provides pattern.two.external.PublicInterface with pattern.two.implA.ImplA; ...Read now
Unlock full access