The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

vyurik (76) [Avatar] Offline
#1
Hi Authors,
Here is what it says now:
By changing the mytrips reference definition to the following:
<reference name=”mytrips” target=”TourProvider/Tours”>
<interface.java interface="com.goodvaluetrips.Trips" />
</reference>
IMO, since the target has been changed to TourProvider/Tours, interface also should be changed to something like:
"com.toorprovidertours.Tours"

Regards,
Vitaly
simon.nash (37) [Avatar] Offline
#2
Re: Section 2.4.1 p.11 interface name shuld be replaced
There is no need to change this interface when changing the target.

Unlike languages like Java, SCA does not require an identical interface at both ends of a wire. It only requires that the operations of the reference interface interface are available as operations on the service interface. In this case, the com.goodvaluetrips.Trips interface is defined as

@Remotable
public interface Trips {
String checkAvailability(String trip, int people);
}

The only requirement on the TourProvider component is to provide a service whose interface has the same checkAvailability() method as the above (or the equivalent in some other language if TourProvider isn't implemented in Java). So for example, it is fine if the mytrips reference uses the interface com.goodvaluetrip.Trips and the TourProvider/Tours service uses the interface

package com.budgettours;

@Remotable
public interface TripsandTours {
String checkAvailability(String trip, int people);
String getAlternativeTrip(String trip, int people);
}

This interface has a different package name, a different interface name, and an additional method that requests an alternative for a "sold out" trip. Despite all these differences, a service that provides this interface can be used as a compatible wiring target for a reference that has the com.goodvaluetrip.Trips interface.

It would probably be worth adding this explanation to the book, to show how SCA interfaces are more flexible than Java interfaces.
vyurik (76) [Avatar] Offline
#3
Re: Section 2.4.1 p.11 interface name shuld be replaced
Thanks for your clarification, Simon.

I was thinking in terms of Java interface.
Regards,
Vitaly