comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Re: About good practice: Should protected objects be small?
Date: Fri, 20 Oct 2017 21:12:35 -0700 (PDT)
Date: 2017-10-20T21:12:35-07:00	[thread overview]
Message-ID: <c48926e9-e239-4393-8eb1-baef2e061d6c@googlegroups.com> (raw)
In-Reply-To: <f4utgrF6jsmU1@mid.individual.net>

On Friday, October 20, 2017 at 8:27:41 PM UTC+2, Niklas Holsti wrote:
> On 17-10-20 17:50 , reinert wrote:
> > I am testing out using protected objects.
...snip...
> 
> If your concern is the size of a protected object in terms of the number 
> of source lines of code, do remember that you can call out from a 
> protected subprogram to ordinary subprograms, which can be separate. Of 
> course you must then pass the protected private data as parameters to 
> those subprograms. (Sometimes unit-testing tools force this kind of 
> structure anyway, becase the private parts of a PO may not be visible to 
> the tool.)
> 

OK, this is what I did (to avoid a more than 2000 lines protected object body).
However, I would like a stub ("is separate"). Why they did not allow this in a protected object? I thought the reason was that protected objects should be "small" for some good reasons (at least in terms of number of statements).

reinert




> -- 
> Niklas Holsti
> Tidorum Ltd
> niklas holsti tidorum fi
>        .      @       .

  parent reply	other threads:[~2017-10-21  4:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 14:50 About good practice: Should protected objects be small? reinert
2017-10-20 18:27 ` Niklas Holsti
2017-10-20 19:21   ` Dmitry A. Kazakov
2017-10-21  4:12   ` reinert [this message]
2017-11-06  5:41 ` Robert Eachus
2017-11-06  8:27   ` Niklas Holsti
2017-11-12  4:16     ` Robert Eachus
replies disabled

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