I've been working with user interfaces at my job and this is what I have come up with for the time being. So chew on this for a little bit and tell me what you think. I've been setting up my user interface to implement the same interface as my service. Now the UI doesn't actually perform any of the leg work that the service itself should perform. It simply acts as a liaison between the user and the service by calling methods within the service depending on what the user input. The UI also extends Entry and is set up as attributes of the service. I did this because the search criteria for a service is often (as in my case) the interface which the service implements, so the client already knows what this interface looks like. This also makes it easier to pass parameters from the client to the UI, because the method the client calls is defined by the same interface that the service implements. The client would make the exact same method call to the UI that it would make to the service itself. Once a client finds a service implementing a particular interface then the client can also look for attributes that implement that same interface if the client wants to use a UI. Once the UI is accessed via a method defined by the interface it implements it goes about its business of creating the UI while calling methods from the service in which it is associated. Of course, the client can directly access the service itself if, for what ever reason, it doesn't want to use the UI. I plan to include 'name' and 'function' fields for the UI to be more descriptive about it's functionality.
Obviously, it would be more practical to define a standard interface for UIs that is packaged with Jini. And my method is only applicable if the client knows what interface the service implements. What are your thoughts?