[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: [Cvslog] r27565 - in /lyx-devel/trunk/src: Buffer.cpp Buffer.h
From:       Andre Poenitz <andre.poenitz () mathematik ! tu-chemnitz ! de>
Date:       2008-11-17 11:02:50
Message-ID: 20081117110249.GA5648 () tu-chemnitz ! de
[Download RAW message or body]

On Sun, Nov 16, 2008 at 03:31:02PM -0500, rgheck wrote:
> poenitz@lyx.org wrote:
>> Author: poenitz
>> Date: Sun Nov 16 18:49:00 2008
>> New Revision: 27565
>>
>> URL: http://www.lyx.org/trac/changeset/27565
>> Log:
>> move more stuff from buffer_func to Buffer
>>
>>   
> Andre: What's your view about when one should use external functions and  
> when one should use static class functions? It looks as if this move  
> involves swapping the former for the latter.

No, it's not a static function now, it's a proper member like several
dozen others as well.

At some point of time I fell for Scott Meyer's "free functions improve
encapsulation" (see e.g. http://www.ddj.com/cpp/184401197).

While the idea is still sound the gain is very slim, and there is a
drawback that has not been mentiond there: To apply the rule "use free
functions if it uses only the public interface" one has actually to
know the precise implementation which pretty much violates the principle
that the interface should not depend on the implementation.

So now I tend to think that "if it is mainly related to Foo, first
choice should be a member function of Foo."

Andre'
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic