comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: newbie - OOP in Ada Set and Get Methods
Date: Wed, 29 Dec 2004 17:35:20 +0000 (UTC)
Date: 2004-12-29T17:35:20+00:00	[thread overview]
Message-ID: <cqupsn$ep1$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: 1104314768.942556.71380@z14g2000cwz.googlegroups.com

R <ruthless@poczta.onet.pl> wrote:
: 
: 'in parameters cannot be modified inside function'(sth like this),

This helps you abide by a principle called query command separation:

: procedure Set(this: in out rec1; s: Integer) is

this is the command, and the Get function is the query.
the principle says that queries should never modify the object.
Commands do in general modify the object.

(You can still implement a query using a procedure that has
an out parameter.)


-- Georg



  parent reply	other threads:[~2004-12-29 17:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-28 12:41 newbie - OOP in Ada Set and Get Methods R
2004-12-28 13:36 ` Jeff C r e e.m
2004-12-28 16:26   ` R
2004-12-28 17:01     ` Jeff C r e e.m
2004-12-28 17:30       ` R
2004-12-28 17:20     ` Martin Dowie
2004-12-28 17:36       ` R
2004-12-28 19:47         ` Mark Lorenzen
2004-12-28 19:48         ` Adrien Plisson
2004-12-28 19:58         ` Georg Bauhaus
2004-12-28 21:17         ` Martin Dowie
2004-12-29 10:06           ` R
2004-12-29 12:33             ` Martin Dowie
2004-12-29 17:35             ` Georg Bauhaus [this message]
2004-12-29 19:12             ` Martin Krischik
2004-12-30 12:14               ` Georg Bauhaus
2004-12-29 19:11         ` Martin Krischik
2004-12-28 13:39 ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox