Re: Interface complexity problem in game
- From: Brendan Guild <dont@xxxxxxx>
- Date: Tue, 27 Sep 2005 03:46:14 GMT
"H. S. Lahman" <h.lahman@xxxxxxxxxxx> wrote in
JwUZe.4140$qC4.425@trnddc02:">news:JwUZe.4140$qC4.425@trnddc02:
> Responding to Guild...
>
> OK, but a couple of caveats. Facades should be simple. That is,
> they should not contain problem semantics in their implementations;
> they exist purely as a decoupling agent to hide detailed
> implementations. Ideally they simple redirect a message. However,
> that segues to the second caveat...
I've got that part, no problem.
> Note that in event-based processing one needs only one processEvent
> (event id, <data packet>) method in the interface. This is
> fundamentally equivalent to a bunch of processAnEvent (<data packet>)
> methods, which is why lots of methods in a Facade interface is not a
> problem.
That's true, but some nonfundamental things are better with methods
instead of event ids. I can have compile-time checking of the type of
data packet. Methods are a little simpler and easier to document than
event ids. I'd need some kind of switching code to identify the event
ids and unpack the data packet before I pass the message on.
> The real key to decoupling, though, is that only by-value data is
> passed. The data packet may be implemented as an object (this is
> what DAO is about) but it exists only for the communication. That
> is, one does not pass objects across the subsystem boundary that are
> part of the subsystem implementation because that exposes the
> subsystem implementation.
I'm a little uncertain about this part. I am passing objects through
the facade, but they may or may not be considered part of the subsystem
implementation. I have a world filled with active entities, game
creatures, and I let them interact through a facade so that I don't
have to reveal how the entire world is implemented, but I do let them
pass objects to the facade that will go to other creatures and play an
active roll inside them.
I'm only revealing to each creature that there are other creatures on
the other side of the facade that are implemented the same way.
The facade isolates each creature from the rest of the world, so there
will be always creatures on both sides, which blurs for me what is
actually part of the subsystem.
.
- Follow-Ups:
- Re: Interface complexity problem in game
- From: H. S. Lahman
- Re: Interface complexity problem in game
- References:
- Interface complexity problem in game
- From: Brendan Guild
- Re: Interface complexity problem in game
- From: H. S. Lahman
- Re: Interface complexity problem in game
- From: Brendan Guild
- Re: Interface complexity problem in game
- From: H. S. Lahman
- Interface complexity problem in game
- Prev by Date: Re: Factory pattern and building object
- Next by Date: Re: Factory pattern and building object
- Previous by thread: Re: Interface complexity problem in game
- Next by thread: Re: Interface complexity problem in game
- Index(es):
Relevant Pages
|