*blink*

But those two components should not be tightly coupled.

Bad example, I think.

The HTTP client doesn't depend on the image parser; it's used to
provide HTTP services to a number of different components of a
browser. You could use the HTTP client code in complete isolation from
knowing anything about images - it might not even be used for a visual
browser. Exchanging data via HTTP is all it should do and all it
should care about.

As for the image parser, it's likely you'd have more than one image
parser - one for PNG, one for GIF, one for JPEG and so on. They don't
care whether they're parsing data fetched from an HTTP client or from
a local file. They just parse data.

The browser itself connects up the pieces. As I've already pointed
out, think of a browser displaying a local JPEG image. The HTTP client
code isn't even involved in that process. Then think of a browser
fetching, say, a text file. The image parser isn't involved in that
process.

I'm not saying you _couldn't_ write a browser where the two were
inextricably connected, but that's just poor design, it really is, if
you ever want to reuse any of your code or extend your browser in any
way.

Perhaps you can give a better example :-)

Ian

On Tue, Nov 17, 2009 at 8:34 PM, Henrik Andersson <he...@henke37.cjb.net> wrote:
> Ian Thomas wrote:
>>
>> In which case they're actually one component, conceptually - if the
>> dependencies are really that inextricable. :o)
>>
>
> Two sub modules in a webbrowser is a http client and an image parser. Yet,
> they need to cooperate for images to download while being displayed.
>
> When do you draw the line? How does submodules interact with this rule? In
> the end, you need to start focusing on the individual case.
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to