Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » Re: Id/Name not on SBase
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Neil Swainston


Posts: 66
Location:
Manchester
Registered:
October 2007
Re: Id/Name not on SBase 06 Sep '09 10:44 Go to previous messageGo to previous message

Hi all,

> I'm not sure why Neil thinks the functions are deprecated !

Largely because both my IDE and ant tell me. As does the source code:

/**
* Returns the value of the 'metaid' attribute of this object.
* ...
* @deprecated libSBML internal
*/
public String getId()
{
return libsbmlJNI.SBase_getId(swigCPtr, this);
}

However, while I understand the logic of deprecating this, I would
still quite have liked the base class NamedSBase or whatever with get/
set name/id in them... But I'll let it lie and implement a few helper
methods.

Cheers,

Neil.

Neil Swainston
Experimental Officer

Manchester Centre for Integrative Systems Biology
Manchester Interdisciplinary Biocentre
University of Manchester
Manchester M1 7DN
England

On 5 Sep 2009, at 20:34, Sarah Keating wrote:

> Hi Guys
>
> NOTE: I changed the subject and really any further discussion on this
> topic should go to
> sbml-interoperability@caltech.edu
>
> I'm not sure why Neil thinks the functions are deprecated ! The
> functions
> on SBase are not documented, because the implementation on SBase is a
> helper function for existing users. New users should really use the
> set/get Id/Name functions on the appropriate derived class.
>
> Just for the record - sorry if I'm repeating myself :-)
>
> In libSBML-3 and earlier the id and name attributes were members of
> the
> base class SBase. This was a MISMATCH with the SBML specification.
> This
> inconsistency caused problems for new users. It also provided the
> opportunity to set an attribute on an element that did not in fact
> have
> that attribute - creating invalid SBML.
>
> In order to address these issues and pave the way for SBML L3
> extensibility, libSBML-4 moved the id and name attributes from SBase
> to
> the derived classes (where appropriate). This caused problems for
> existing users who use the base class to loop through different
> elements
> within the model and required set/get Id/Name. So libSBML-4 added the
> functions back to SBase as a helper function. These functions merely
> look at the SBMLTypeCode on the object and use a switch statement to
> cast the object
> to the appropriate class before calling the class specific function.
>
> SBMLTypeCode_t type = this->getTypeCode();
>
> switch(type)
> {
> case SBML_COMPARTMENT:
> return static_cast <const Compartment *> (this)->getId();
> break;
>
> ...
>
> LibSBML for SBML L3 core and earlier levels will have this
> functionality. However, once libSBML becomes extendible we anticipate
> that package developers will provide code for their own package which
> will communicate with the core libSBML but not impact the code
> directly.
> Thus as packages introduce new elements derived from SBase the
> facility
> to setId/Name from the SBase class may be lost.
>
> If you commonly use get/set Id/Name on an SBase object it may be worth
> implementing your own helper function to do this :-)
>
> Sarah
>
>
>
>
>
> ____________________________________________________________
> To manage your sbml-discuss list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>
> For a web interface to the sbml-discuss mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-discuss list,
> contact sbml-team@caltech.edu

____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

[Updated on: 17 Sep '09 21:35] by Moderator

      

SubjectPosterDate
Read Message   Re: Id/Name not on SBase Sarah Keating05 Sep '09 12:34
Read Message   Re: Id/Name not on SBase Allyson Lister05 Sep '09 14:36
Read Message   Re: Id/Name not on SBase Sarah Keating07 Sep '09 08:14
Read Message   Re: Id/Name not on SBase Neil Swainston06 Sep '09 10:44
Read Message   Re: Id/Name not on SBase  Neil Swainston06 Sep '09 10:44
Read Message   Re: [sbml-discuss] Id/Name not on SBase Sarah Keating07 Sep '09 08:27
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: [sbml-discuss] Id/Name not on SBase Allyson Lister10 Sep '09 02:03
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: [sbml-discuss] Id/Name not on SBase curoli07 Sep '09 09:50
Read Message   Re: Id/Name not on SBase Lucian Smith10 Sep '09 14:08
Previous Topic:ordering of MIRIAM annotations
Next Topic:c/C++ open-source kinetics simulator
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.