[MOBY-l] MobyDataSetInstance vs MobyDataSimpleinstance

Paul Gordon gordonp at ucalgary.ca
Tue Apr 19 14:16:40 UTC 2005


Yup, I'll be there.  We've definitely got critical mass on the Java side 
for a good BoF!

I think that the advantage of using MobyDataSetInstance instead of 
MobyPrimaryDataSet (I assume MobyPrimaryDataSimple was a typo in the 
original e-mail) is that you get a two-for-one.  Why build a 
MobyPrimaryDataSet to find a service (including creating all of the 
MobyPrimaryDataSimple that go in it), then use some other classes to 
generate the XML to run the service?  The MobyDataInstance implementers 
allow you to do both by instantiating one object, or even better, if you 
got data back from a service, you don't need to instantiate any objects 
yourself at all...

All of the extension classes I've made inherit methods from the parent 
class when possible,
but all of the toXML() methods are overriden because they must be able 
to generate
service request formatted XML, not just service template XML (hence 
MobyDataInstance.setXmlMode()).

You are right though,  I should move the modified MOBY Central parts of 
MobyDataSetInstance.toXML() up to MobyPrimaryDataSet and call the 
super's method explicitly when the requested XML mode is appropriate.
Doing that now...

Martin Senger wrote:

>Ben,
>   I gues that Paul already answered your questions about this - but still
>I wonder what have you been trying to do... It seems to me that you were
>creating a service template to send it to the registry in order to find
>matching services. Correct? I wonder why you needed MobyDataSetInstance at
>all for that? The MobyDataSetInstance is Paul's extension to
>MobyPrimaryDataSimple - but the class MobyPrimaryDataSimple already has
>everything (I hope) to create a template for communicating with the
>registry.
>   This probably reflects one of the bad things in jMoby - we have a lot 
>of similarly named classes that (perhaps) overlap each other. I hope we 
>will have chance to discuss it in the jMoby BoF in Vancouver. Paul, are 
>you coming there?
>
>   Regards,
>   Martin
>
>On Thu, 14 Apr 2005, Benjamin Good wrote:
>
>  
>
>>There is no .setXmlMode in MobyDataSetInstance .  I think this will 
>>cause problems requesting services from Central ..??
>>
>>Has anyone built a collection in a java and used it to query for 
>>services successfully?
>>
>>I built a collection of Objects as below and didn't find any matching 
>>services?  This should match anything that accepts a collection as 
>>input because of the inheritance from object right??
>>
>>            //specify a dataype for use in the input to the template 
>>service
>>            MobyDataType type = new MobyDataType("Object");
>>//make a jMoby object to act as the input to the template (and later 
>>the actual call)
>>            MobyDataSimpleInstance input1 = new MobyDataSimpleInstance 
>>("");
>>            input1.setDataType (type);
>>            input1.addNamespace (new MobyNamespace ("NCBI_gi"));
>>            input1.setId("111076");
>>
>>            MobyDataSimpleInstance input2 = new MobyDataSimpleInstance 
>>("");
>>            input2.setDataType (type);
>>            input2.addNamespace (new MobyNamespace ("NCBI_gi"));
>>            input2.setId("111077");
>>
>>            MobyDataSimpleInstance[] inputset = new 
>>MobyDataSimpleInstance[2];
>>            inputset[0] = input1;
>>            inputset[1] = input2;
>>            MobyDataSetInstance input = new 
>>MobyDataSetInstance("",inputset);
>>
>>//specify that the xml generated for this object by the getXML method
>>//is suitable for communicating with moby central --- doesn't exist!
>>         //   input.setXmlMode(MobyDataSimpleInstance.CENTRAL_XML_MODE);
>>//add the moby object as input to the template service
>>            templateService.addInput(input);
>>
>>//Find services that match this template service
>>            MobyService[] validServices = 
>>worker.findService(templateService);
>>
>>-> finds none
>>-> why?
>>
>>thanks!
>>-Ben
>>
>>
>>http://bioinfo.icapture.ubc.ca/bgood
>>
>>_______________________________________________
>>moby-l mailing list
>>moby-l at biomoby.org
>>http://biomoby.org/mailman/listinfo/moby-l
>>
>>    
>>
>
>  
>




More information about the moby-l mailing list