Observer Pattern

Nov 24, 2004 03:46

I've often mentioned the idea of changing application programming so more responsibility is offloaded to "The System" (or "The Framework") for managing invalidation. What I'm suggesting isn't quite as pathological as "Completely recompute the layout of every page in Microsoft Word on each keystroke". But I do think that programmers could express ( Read more... )

Leave a comment

Comments 7

earhart November 24 2004, 18:22:38 UTC
Have you done much Prolog programming?

Reply

Prolog benzene November 24 2004, 20:11:56 UTC
Many years ago I looked at it enough to see how it implemented the classic knowledge base "I'm thinking of an animal" process of elimination problem. (I saw one of these just the other day being marketed as an electronic handheld gadget, which I couldn't resist trying out.)

What I was messing with here really does have a lot in common with functional programming, and increasingly I saw that it needed its own language. People have enough trouble closing files that they open, so when you ask for them to write stylized C++, it's kind of a lost cause. I had come up with a few tricks, which can be simplified a bit to demonstrate what I'm talking about:

class TreeNode
{
...
private: // can't call constructors explicitly
TreeNode();
TreeNode(std::string data);
public:
static std::auto_ptr Create(std::string data); // use this instead
...
public:
TreeNode* InsertChild(std::auto_ptr child);
std::auto_ptr Detach();
...
};Then, I was using protected inheritance to make derived classes with no data members that ( ... )

Reply

std::auto_ptr benzene November 24 2004, 20:13:45 UTC
That should read std::auto_ptr, of course.

Reply

Re: std::auto_ptr benzene December 1 2004, 14:17:58 UTC
figured out the problem. I'd typed everything correctly, it's just that > and < cause problems.

IT SHOULD SAY: std::auto_ptr

Reply


olego November 26 2004, 07:42:52 UTC
Hey,

I've personally become disillusioned with C++, so I would write

TreeNode* GetParentMaybeNull

but call it simply GetParent() and expect a NULL if there is no parent.

And std confuses me. :-P

Reply

olego November 26 2004, 07:43:13 UTC
became^

Reply


Disney Cars Online anonymous January 24 2011, 00:05:57 UTC
This is presumably the most remarkable blogs Ive go off result of in a very prolonged time. The amount of info in here is astonishing, like you clearly wrote the rules around the theme matter. Your weblog is great in search any peculiar who desires to absorb this put through much more. Talented things; want retain it up!
[IMG]http://www.sedonarapidweightloss.com/weightloss-diet/34/b/happy.gif[/IMG]

Reply


Leave a comment

Up