Applying the Law of Demeter

Dennis Lee Bieber wlfraed at ix.netcom.com
Sat Dec 14 15:16:33 EST 2002


Anna fed this fish to the penguins on Saturday 14 December 2002 11:01 
am:

> 
> Reading this thread, it occured to me, would this Law of Demeter
> qualify as a namespace issue? (Or am I totally off on that...?)
>
        Only if mixing Greek and Roman (Persephone vs Proserpina (sp?)) <G>

        I'd consider the LoD more of an encapsulation issue. If your goal is 
to perform a transaction on an Automated Teller Machine, all you should 
need to know is the User (via ATM card mag-strip & PIN), and 
transaction details (deposit/withdrawal/transfer, account(s), amount). 
You shouldn't have to know or invoke operations for connect-to-bank, 
validate-PIN, validate-accounts... etc. All those operations should be 
handled from within the transaction logic.

        Yes, that is a weak example...

-- 
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




More information about the Python-list mailing list