T
Tom Anderson
I wasn't. And, someone has written the "all-in-one" constructor for me:
in = new ObjectInputStream( inputStream );
room = (Room)in.readObject();
will do that. So if I had to I'd use some variation on that method. The OP
wanted a way to load objects with a single load method; that's what I was
trying to give him.
I got the impression his assignment involved a specified file format which
he had to read, BICWBW.
My opinion is that all types of design patterns are needed, and should
be used. Trying to force a pattern onto a design is going to make the
design brittle, hard to maintain, etc. Use builders where they are
needed. Use POJO were it's needed. Use EJB where it's needed.
Couldn't agree more. Patterns are specific solutions to specific problems:
applying them where the problem is absent is not a good thing!
Anyway, i think we've covered pretty much every angle on this problem. I'd
be impressed if the OP was still with us!
tom