In my design, the Data class is fully encapsuled in a DataFactory, which is in turn used by a <Remote/Local>BusinessService that implements the interface BusinessService:
Collection findByCriteria(Criteria criteria);
Bookable book(Bookable bookable, BigInteger requested seats);
In this way, the client does not call directly the criteriaFind or getRecord method(it doesn't know anything about how the data is retrieved), but it iteracts with a command pattern which uses a remote or local BusinessService and return the business object (an object which implements the Bookable interface).
Is that design wrong?? The instructions.html says : "The remote client code should implements all the public method of the Data class".
I think the client code shouldn't know the method getRecord, criteriaFind. The server(local or remote) should must hide this details providing any method like book, findByCriteria, findByPrimaryKey, etc...
Thanks everyone...
Collection findByCriteria(Criteria criteria);
Bookable book(Bookable bookable, BigInteger requested seats);
In this way, the client does not call directly the criteriaFind or getRecord method(it doesn't know anything about how the data is retrieved), but it iteracts with a command pattern which uses a remote or local BusinessService and return the business object (an object which implements the Bookable interface).
Is that design wrong?? The instructions.html says : "The remote client code should implements all the public method of the Data class".
I think the client code shouldn't know the method getRecord, criteriaFind. The server(local or remote) should must hide this details providing any method like book, findByCriteria, findByPrimaryKey, etc...
Thanks everyone...