Talk:Stateless and pure

Revision as of 22:36, 30 June 2011 by Colin-adams (Talk | contribs) (New page: I think the way to have stateless routines is simply to put them in classes with no attributes. Then the class should be marked as stateless in some syntactic way (something more obvious ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I think the way to have stateless routines is simply to put them in classes with no attributes.

Then the class should be marked as stateless in some syntactic way (something more obvious than an = sign - stateless class, perhaps). Tools can then indicate to a programmer that an individual routine happens to be stateless.

Then a (sufficient, but not necessary) validity rule would be that a statefull class inheriting from such a stateless class may not redefine the routine. --Colin-adams 07:36, 1 July 2011 (UTC)