HighTechTalks DotNet Forums  

Lack of OO support for stateless programming

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss Lack of OO support for stateless programming in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old   
Greg Young
 
Posts: n/a

Default Re: Lack of OO support for stateless programming - 08-16-2006 , 02:00 AM






I believe the pool is up to $25 from the advanced dotnet group now for
someone to implement an FXCop rule to do this

Cheers,

Greg
"Chris Mullins" <cmullins (AT) yahoo (DOT) com> wrote

Quote:
"Greg Young" <druckdruckREMOVEgoose (AT) hotmail (DOT) com> wrote
Chris it seems to me that you are NOT looking for the ability to put
static methods in an interface but you are looking for a method to mark a
method as stateless. The fact that a method is static does not make it
stateless.

Very true. I can (and do) write occasional static constructors, static
variables, and other stateless no-no's.

For the most part through, static means something pretty close to
stateless.


Getting back to the stateless issue C++ has a weak form of this in const.

Yea, that's not quite what I'm looking for either though. I've done alot
of C++ programming, and I do miss const and mutable in .Net, but I can get
along without them. I do quite like readonly member variables, as they can
only be written to in the constructor.

The ability to mark that a method is stateless (and therefore thread
safe) has been on the wish list of many for a long time.

I would certatinly like this, although I still want to have it enforced by
base classes and/or interface definitions.

Ah well, perhaps C# 4.0 will have it...

--
Chris Mullins, MCSD.Net, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins







Reply With Quote
  #12  
Old   
Chris Nahr
 
Posts: n/a

Default Re: Lack of OO support for stateless programming - 08-16-2006 , 03:48 AM






On Tue, 15 Aug 2006 15:24:21 -0400, "Greg Young"
<druckdruckREMOVEgoose (AT) hotmail (DOT) com> wrote:

Quote:
Getting back to the stateless issue C++ has a weak form of this in const.
Well, if you're being pedantic about "stateless" I would have to say
that C++ const is no such thing. It does not _modify_ a state but it
can still _access_ a state. Since another function might modify that
state while the const function is reading it, this also means that a
const function is not per se thread-safe.
--
http://www.kynosarges.de


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.