Re: Encapsulation vs separation of concerns

From: Daniel T. (postmaster_at_earthlink.net)
Date: 01/01/05


Date: Sat, 01 Jan 2005 06:05:27 GMT


"Mark Nicholls" <nicholls.mark@mtvne.com> wrote:

> "Daniel T." <postmaster@earthlink.net> wrote:
>
> > So you see, there is no tradeoff, one can have fully encapsulated
> > classes *and* a strong separation of concerns.
>
> OK, but in order to seperate concerns (into seperate modules/subsystems) one
> has to formalise interfaces for those concerns to interact. Unfortunately in
> most OO environments this entails exposing those interfaces to the world
> i.e. unencapsulating them. If you keep the concerns entwined within the same
> module, then this interaction is a completely private encapsulated
> interaction.

There seems to be some confusion as to what interfaces are. A class that
implements an interface is fully encapsulated because the interface is
the shell or capsule that contains the implementation.

> Encapsulation (to me) is not an absolute property, but a sliding scale,
> based on the context of it's clients requirements.

I'm happy to agree here, at least to an extent. A class can be
encapsulated or not. If it isn't, then there are degrees of exposure.

> The only 'fully encapsulted class' is the empty class......
>
> module UselessModule
> {
> private class CIAmAlmostFullyEncapsulatedYetICanDoNothing
> {
> private CIAmAlmostFullyEncapsulatedYetICanDoNothing() {}
> }
> }

I think you are wrong here. A fully encapsulated class can still expose
an interface, that's the whole point of the capsule part...



Relevant Pages

  • Re: Part 2; COM issues
    ... The COM configuration defines how the object ... Yes but these differences are as you wanted, a seperate concern. ... completely encapsulated by this object factory. ... another spin on this lies in the nature of interfaces. ...
    (comp.object)
  • Re: SoA Vs OO
    ... >> more seperate public interfaces as part of the language... ... Let's take a bog standard producer/consumer scenario where the producer ... the producer should only produce and the consumer ...
    (comp.programming)
  • Re: simple ping; pinging 101
    ... Why do you have the same subnet on two interfaces? ... easier to seperate the traffic maybe in /24 or /29 networks to seperate ... other networks on different interfaces. ...
    (Fedora)