Anybody see any glaring holes?
Originally posted by Michael Morris:
Nope. Sounds well thought out. If your testing shows that everything works with multiple clents connected, then I'd say you're ready to upload, go take the essay exam and become a SCJD2.
The Facade (implements a Data Interface)
Originally posted by Mark Spritzler:
Does this mean your Facade has the same public methods as Data, or does it have much less methods that are like bookFlight() searchFlight?
If it has all the methods of Data then it really isn't a Facade.
Originally posted by Jim Bedenbaugh:
We could probably get into some academic discussion about this, but the reality is that it's closer to being a Facade pattern than anything else in the GoF patterns, so that's what I call it (I'll get more particular about this when I take the SCEA cert, I suppose). I do include the the same methods as the Data class class, because the specs say:
Writing Data Client
To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration.
Originally posted by Nate Johnson:
Anyway, the way I understood patterns was that a facade is a simple interface to complex subsystems. Things like booking flights that require doing a lot of work, but is something in general that a developer would want to call. The developers that needed to do the dirty work could still get to the subsystems directly, but for the 80-90% of developers, the simpler facade methods would do the trick.
I took the "all public methods..." quote from sun as needing to implement the DAO pattern. That way a database could easily be swapped out for another database. You implement a few interfaces that would work for any db and implementations that talk to the Sun stuff, but then implementations could be written to talk to any database (flat file, relation db, oodb, etc). Then your business code never has to change since you would be using the generic interfaces and probably some connection factory.
You kind of combined the Facade methods with the Data methods.
So all you really have to do is create a class that takes the Facade methods you have in your class and copy them into this new class, and have it have an instance of your other class.
Or I could just change my documentation and say I implemented a Proxy class.