From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9c6e774bffb6a09e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.75.170 with SMTP id d10mr8463084pbw.6.1326745886501; Mon, 16 Jan 2012 12:31:26 -0800 (PST) Path: lh20ni189774pbb.0!nntp.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!192.87.166.28.MISMATCH!tudelft.nl!txtfeed1.tudelft.nl!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!193.252.117.184.MISMATCH!feeder.news.orange.fr!not-for-mail Message-ID: <4F14891D.8000903@gmail.com> Date: Mon, 16 Jan 2012 21:31:25 +0100 From: Stephane Carrez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 Newsgroups: comp.lang.ada To: AdaMagica Subject: Re: : Ada Utility Library 1.4.0 is available References: <4f13480d$0$5689$ba4acef3@reader.news.orange.fr> <6c0b74d1-6d8d-4ef8-9132-c4e57b48f323@w4g2000vbc.googlegroups.com> In-Reply-To: <6c0b74d1-6d8d-4ef8-9132-c4e57b48f323@w4g2000vbc.googlegroups.com> Organization: les newsgroups par Orange NNTP-Posting-Date: 16 Jan 2012 21:31:26 CET NNTP-Posting-Host: 90.46.179.192 X-Trace: 1326745886 reader.news.orange.fr 2512 90.46.179.192:5643 X-Complaints-To: abuse@orange.fr Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-01-16T21:31:26+01:00 List-Id: 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