FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open Call for Suggestions: Project Direction and Features
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic     Forum Index -> Ares
View previous topic :: View next topic  
Author Message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Mon Aug 30, 2004 7:21 pm    Post subject: Re: my 2c... Reply with quote

regan wrote:

in the above you can use the class as 'auto' so making it a class is perhaps the best approach. I think you could do other cool things with a class like storing a list of methods loaded from the library, perhaps with an AA?


It's funny you mention that. Take a look here: http://svn.dsource.org/svn/projects/dsp/trunk/misc/typeLibrary.d

Keep in mind that the Library base class in this case could be meshed with the LibraryCache type (same SVN directory) while keeping it pretty transparent to the user. This *could* have been done with free functions in D, but then I'd loose the ability to work with the callback lists (events) in the Library class.

I guess what I'm getting at is that I agree with many of you that going with one overall library type (classes vs functions) is very dependent on wether or not state is maintained as a free function setup is a degenerate case of a simple class. Overall, it really comes down to a matter of style and utilty, which is stacked squarely on top of that notion.

Quote:

I don't think choosing OO or non OO is the path to take but rather to choose the best approach per situation/module. If it can be done best as free functions, then do it that way, you can always add a additional class wrapper for those who want pure OO. The best of both worlds IMO.


I couldn't agree more. Smile
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Ares All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group