[whups] Re: library conventions and state of play
Anil Madhavapeddy
anil@recoil.org
Mon, 25 Dec 2000 17:10:44 +0000
Quoting Chuck Hagenbuch <chuck@horde.org>:
> Quoting Anil Madhavapeddy <anil@recoil.org>:
>
> > I decided that the human-readable diff was just a html rendition
> > of the unified diff, and so shouldn't really have its own class
> > (since it is presentation layer).
>
> That's not necessarily a reason. Model-View-Controller is all about
> _seperating_ the presentation layer, but the presentation layer is still
> something that you design - there's some logic there, especially in
> representing diffs - so I think there's a good reason to put different views
> into their own CVSLib_diffView_* classes.
>
Well, it depends what level of abstraction you want, and what use
will be derived from it. If we do want to abstract the
unified diff -> hr-diff by returning a series of classes, back then
I figured it was needless abstraction, since it was being done with
a popen pipe, so a lot of memory wouldn't for large diffs by storing the
entire thing in a PHP array, and then returning that for HTML rendering.
Now, we have another kind of diff that can use the same data format
(the strike-through diff), so it does make a lot more sense to shift the
logic over to CVSLib_diff(View)_* classes and bundle up the presentation.
--
Anil Madhavapeddy, <anil@recoil.org>