[Solar-talk] Quick thoughts on new factory() method instantiation

Travis Swicegood development at domain51.com
Wed Jan 3 10:16:42 PST 2007


Howdy all...

Paul M Jones wrote:
> On Dec 13, 2006, at 7:10 AM, Rodrigo Moraes wrote:
>   
>> On 12/11/06, Paul M Jones wrote:
>>     
>>> Of the remaining two, I like solarFactory() better.  The property
>>> idea seems a bit too loose, even for me.
>>>       
>> +1 solarFactory().
>>
>> A method named factory() can exist in other external libraries, as
>> happened to Travis. However Solar::factory() would not be used for
>> external libs unless the constructor follow Solar's constructors, and
>> then, for classes made to work with Solar, perhaps it would be ok to
>> just avoid methods named factory(). But I like the idea of prefixing
>> with 'solar' because it tells that it is a method that Solar will try
>> to evoque, and would avoid conflicts with non-Solar classes.
>>     
>
> Agreed; just committed to SVN.  Thanks for the feedback.  :-)
>   

I was just thinking about this yesterday actually.  What about naming it 
_solarFactory().  Of course, it would still need to be public so 
Solar::factory() could call it, but my thought is that it shouldn't be 
called directly, so creating the pseudo-protected naming would help 
underline that.

-T


More information about the solar-talk mailing list