Recap on services

In our first netlet example, Hello1Client, we used a warrant to access a service. That netlet, and indeed any netlet, uses the bindService() method to connect to such a service.

Now we know that any such service is accessed via another netlet. That other netlet, the access point netlet, downloads and presents facets (such as IHelloFacet) to the client netlet.

In our example the facet supplied a not-very-exciting hello message, and it was unclear whether that message came directly from the access point netlet or from a central server, and just retrieved by the access point netlet. But in fact it didn't matter. The access point netlet itself was not accessible to our client netlet--only its facet was.

And that's really the point about services: all the client deals with is the service interface, IService, and everything else comes from there. The access point netlet is irrelevant to the client because it just deals with the service interface.

Nevertheless, that access point netlet is part of the service provided (supplying a hello message). Writing a service involves, at the very least, having an access point to supply the service. Here are some example hello world services and how they might work:

Hello world service 3 might seem wildly ambitious, but in fact that's just the kind of thing the Beatrix framework provides. If you've downloaded the hello world warrant from the Jtrix.org site, you're using Hello world service 2, which is only a small step away from it. It was written with just seven classes within Beatrix. See Programming with Jtrix: The Beatrix application framework6.1for more details.

However, the humbler Hello world service 4 is still a legitimate Jtrix service. It's not as wild, but it's a good solid start. That's what we'll write now.

Nik Silver 2002-03-09