realbasic-betas.mbox
[Top] [All Lists]

Re: reflection in REALbasic?

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: reflection in REALbasic?
From: Matthias Buercher <reader at belle-nuit dot com>
Date: Fri, 30 May 2003 00:35:48 +0200
On Thursday, May 29, 2003, at 23:12 Europe/Zurich, Jason Essington wrote:


  For i = 1 to currentElement.elementCount()
    thisMember = currentElement.getElement(i)

    // here is where the introspection "magic" happens
element = Class.forName(me.memberType).getConstructor(parameterTypes).newInstance (parameters) // this would be cool to do in RB

    element.deserialize(thisMember)
pCollection.Value(i-1) = element // pCollection is a dictionary for storing the members of the collection
  Next

this is possible in RB, but maybe not elegant.
SoapObject is a class interface
you need a global function which creates and returns SoapObject based on parameterTypes. this is the not elegant part, because it's a long case statement and you have to update it for each class you are going to create. SoapObject has a method serialize and deserialize so you do not have to multiply code lines.

matthias




--
Matthias Buercher matti at belle-nuit dot com http://www.belle-nuit.com


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-betas-off at lists dot realsoftware dot com>

Subscribe to the digest:
<mailto:realbasic-betas-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>