Also worth reading today is this short but fascinating PDF paper from Alessandro Warth and Alan Kay. They start from a curious premise: if "tabs" are so useful in browsers, as a way to isolate one unpredictable process from another, wouldn't something similar be useful in general programming? From there, they get into notions of branching program state, and controlling the relationship of these program "worlds" to each other. It's a bit rough, but it's an interesting and novel way of thinking about a program, and I could see it becoming rather useful with some more evolution...
(no subject)
Date: 2008-10-06 06:49 pm (UTC)(no subject)
Date: 2008-10-07 02:50 am (UTC)(no subject)
Date: 2008-10-06 11:23 pm (UTC)I don't know if the authors meant to, but it reminds me a great deal of the EJB "stateful session" -- or of "private instances" implemented in various MMORPGs.
And yes, there are uses. My company has a few projects that actually use this pattern. (It's not what you'd call a "design" pattern. Maybe an architectural pattern?)
(no subject)
Date: 2008-10-07 02:49 am (UTC)That said, doing this really rigorously would be much easier with environment support than without it. In many languages, it's quite hard to enforce the invariants implied here. I've had painful experience with this: the first game engine I worked on at Looking Glass was theoretically beautiful in its architecture, with the data managed and controlled in very elegant ways. In practice, though, it was C++, and wound up with tons of hidden state all over the place, that we didn't find out about until *after* we wrote the first draft of the multiplayer code. (Which depended heavily on that elegant architecture.) Making this work reliably requires either *enormous* discipline, or language support for scope control. I'm not really surprised that they prototyped it in Javascript: while it has its weaknesses, it's surprisingly powerful in terms of scope management.
And to be fair, I think they're talking about something a bit more than a private instance. My original impression was just that, but it sounds like they're talking about something with more ability to share and branch state between instances. So I'm intrigued, although I need to think about the implications a bit more...