comp.lang.ada
 help / color / mirror / Atom feed
From: Stephane Carrez <Stephane.Carrez@gmail.com>
To: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: : Ada Utility Library 1.4.0 is available
Date: Mon, 16 Jan 2012 21:31:25 +0100
Date: 2012-01-16T21:31:26+01:00	[thread overview]
Message-ID: <4F14891D.8000903@gmail.com> (raw)
In-Reply-To: <6c0b74d1-6d8d-4ef8-9132-c4e57b48f323@w4g2000vbc.googlegroups.com>

Hi!

On 01/16/2012 09:10 AM, AdaMagica wrote:
> Hm, I looked at your beans, and I do not see the value of this.
> What's the advantage of returning components with string names versus
> returning them as usual?
> First of all, the components are visible. If they aren't, why not just
> use
>
> function Radius (B: Compute_Bean) return Float;
>

The purpose of these Ada beans is to be able to give access to
object values and object methods from withing a presentation layer.

The benefit of Ada beans comes when you need to get a value or invoke
a method on an object but you don't know at compile time the object or method.
That step being done later through some external configuration or presentation file.

In this case, you need somehow to dynamically retrieve the members of an object
(hence the Get_Value) and see what methods it exposes (hence the Get_Method_Bindings).

In a presentation page, the Ada bean values could be referenced as follows:

   Height: #{compute.height}
   Radius: #{compute.radius}

which triggers a call to Get_Value with the 'height' or 'radius' names on
an object registered under the name 'compute'.

To learn more on this presentation topic, I invite you to look at the following article:

http://blog.vacs.fr/index.php?post/2011/03/21/Ada-Server-Faces-Application-Example


Stephane



      parent reply	other threads:[~2012-01-16 20:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 21:41 [Ann]: Ada Utility Library 1.4.0 is available Stephane Carrez
2012-01-16  8:10 ` : " AdaMagica
2012-01-16 11:48   ` Georg Bauhaus
2012-01-16 20:31   ` Stephane Carrez [this message]
replies disabled

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