libera/#sicl - IRC Chatlog
Search
21:40:20
mfiano
beach: How do you normally subscribe to changes in the model from the view, in a sophisticated CLOS-based application? I am mainly talking about "problem 1" in section 2.1 of the "Using Stealth Mixins to Achieve Modularity" paper (the paper only addresses the "problem 2"). I have considered the observer pattern, but that loosely couples the view in the model, and such mutual dependency circularities
21:40:23
mfiano
make me upset. I am just curious what other options there are, as I've been really thinking on how to make my code more modular lately.
3:05:16
beach
mfiano: I don't have access to the paper, so you need to describe the problems in addition to enumerating them.
3:06:09
mfiano
in summary, the view layer needs to compute some information about the various objects of the model, and store this information for later use. problem 1 is the view subscribing to any modifications in the model, so that these annotations can be
3:07:06
beach
Wouldn't the view then just define an :AFTER method specialized to the stealth mixin class?
3:08:35
mfiano
I don't understand. The stealth mixin paper assumes the reader finds a solution to this problem before stealth-mixins is of use
3:09:08
beach
Oh, sorry, I haven't had my coffee yet. You want to know how this is done without stealth mixins?
3:09:40
mfiano
No, I want to know a solution to the prerequisite discussed that stealth-mixins requires
3:14:27
beach
Well, I don't know of any acceptable solution to the problem without stealth mixins, but the traditional way is the observer pattern.
3:15:14
beach
But, like I said, with stealth mixins, you can then stick an :AFTER method on the operations you want to observe, specialized to the mixin class.
3:16:29
mfiano
I'm reading AMOP, and again I'm greatly confused. It references class-direct-methods in several parts of the prose/examples of chapter 2, but the api index only lists specializer-direct-methods. I am assuming that chapter 2 is just wrong.
3:18:43
beach
The AMOP is a great book (as Alan Kay says) in terms of the message, but it is not that well written.
3:19:11
beach
Several technical books are like that, unfortunately. The garbage collection handbook is another.
3:19:30
mfiano
Well thanks. I've just been doing a lot of reading and asking questions regarding other people's architectural choices in order to refine my process a bit to be more modular.
3:21:36
mfiano
Yes. I spent the last week designing a rather complex multi-layered protocol, and I'm not 100% happy with it. I have some ideas how I would do it better now, but still thinking/reading.
3:27:14
beach
In Cluffer, the view does not subscribe to changes at all. And that's so that the model can change as a result of multiple operations without any actions on the part of the view. For example, deleting a region can be implemented as a loop over each element of the region, and it would not be a good idea to inform the view for each element.
3:29:24
beach
So the model instead tags modifications (coarsely) with a time stamp. When the view needs to be updated (say because it is visible), it invokes the modification protocol to update its stored version of the model according to modifications made after the previous update.
3:30:25
beach
Typically, every view is updated at the end of each iteration in some kind of command loop, but each command can then result in an arbitrary number of modifications to the model.
3:31:35
beach
Yeah, Paul Wilson (of GC fame) taught me this technique when I spent a year with his group in Austin.
3:34:21
mfiano
I use them in a few different ways actually. In one way, the subject sends messages to an event (priority) queue with a relative _future_ time, and each tick events are dequeued and dispatched to all subscribers until the priority queue's next element is > the absolute current time
3:36:39
mfiano
I probably explained that poorly, but subscribing to a message is a progn combination method, and is just a way i designed to queue future event hooks in a not so coupled manner
3:38:14
mfiano
Oh sure. I use that in lots of places actually, usually generational though to solve the ABA problem.
3:39:16
mfiano
I personally think of the timestamps you speak of as simply "serial numbers", so I didn't make the connection at first.