Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Re: Re: Reblessing

by Sherlock (Deacon)
on Jun 21, 2001 at 19:21 UTC ( #90405=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Reblessing
in thread Reblessing

dragonchild hit on a very good point - it seems to me as if you're defining your own message set. If that's the case, it doesn't matter what you need to ask your server, you can define your own way of doing it. It's somewhat like defining your own network protocol. You make a request, your connection object interprets that request and sends it off to the server, then it simply funnels back the reply.

I tried to point out in my first post:

As long as the methods it uses are well thought-out...

The connection object, along with your message set is, by no means, trivial. Far from it! With this sort of architecture, I tend to allow the "smarts" of the application to sit on the outer edge of the application, that being mostly within the client and somewhat within the connection object.

But when you're creating this new message set for yourself, heed dragonchild's advice when he/she says that you need to account for server types that you haven't even thought of yet. Obviously, if you're considering the connection object approach, you're thinking about future expansion and adaptation of this project. That might very well include the use of a new type of server and your message set had better be able to adapt to that easily or your connection object's design is going to go down the tubes in a hurry.

I'd spend some serious time contemplating the message set and where you want to put the "smarts" of this application.

- Sherlock

Skepticism is the source of knowledge as much as knowledge is the source of skepticism.

Replies are listed 'Best First'.
Re: Re: Re: Re: Reblessing
by frag (Hermit) on Jun 22, 2001 at 09:17 UTC

    I've come into this discussion late, but there's something about the way you're (or rather, everyone) is phrasing this issue that's really confusing me.

    It seems to me that the question is whether:
    a) to have multiple possible server objects, and change the identity of an existing server object on the fly via reblessing
    b) to have a single connection object of fixed class, which points to a server object, and replace that server object on the fly by creating a new server object, rather than just reblessing the one that's already there

    In either case, the issue about defining the messages/protocol still comes into play, and would probably be a solved by something like having "generic" messages in a top-level Server class, while having more particular message sets defined in subclasses. (Or else a Message class heirarchy, inherited by different members of the Server heirarchy.) Resolving this issue seems to me to be orthogonal to the question of whether or not to choose a) or b).

    That question of reblessing seems to depend on how you need to treat the attributes of the existing server object. Do you want to pass them along to the next object, without any additional changes or tests, and without (I think) calling DESTROY when the original server object "goes away"? Then go ahead and rebless. Or would that be awful, say because the server subclasses have totally different attributes, and you can't just pass the attributes of a ServerX object into a ServerY? Then don't rebless.

    What am I missing here?

    -- Frag.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://90405]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-01-21 19:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (230 votes). Check out past polls.