Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Corba > Re: typedef seq...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 518 of 552
Post > Topic >>

Re: typedef sequence with user defined objects

by Mark Woyna <woyna@[EMAIL PROTECTED] > Dec 5, 2007 at 06:42 AM

On Dec 5, 3:27 am, "develo...@[EMAIL PROTECTED]
" <develo...@[EMAIL PROTECTED]
> wrote:
> Hi i'm quite new to corba.
> I need to implement Add.idl, but i can't find something similar on the
> net, or some closer examples.
> The idea is to implement the interface Add to store an array of
> results (the sum of a and b). The client sends a and b to the server
> and the server sends back an Add object that contains the resulting
> sum (this is a must, this is how it should be done, i know i could do
> this easier, also found examples
here:http://java.sun.com/developer/technicalArticles/releases/corba/
> ).
> Could anyone give some links to achieve this, or code, or try to do
> this together on this thread?
>
> Here is my idl:
>
> //Add.idl
> module ArithApp {
>
>         interface Add;
>         typedef sequence <Add> AddJob;
>
>         const unsigned short SIZE=10;
>         typedef long array[SIZE];
>
>         interface Add
>         {
>                 AddJob addArrays(in array a, in array b);
>         };
>
> };
>
> Thanks for your time.

The 'Add' interface does not contain any attributes, so there's no way
it can carry a result back to the caller. It's role appears to be a
service-type object, since it contains only operations. Why don't you
change the return type to a long?

Also, I don't believe the 2nd typedef is syntactically correct. It
should be:

  typedef long[SIZE] longArray;

  interface Add {
    long addArrays(in longArray a, in longArray b);
  };

Mark
 




 2 Posts in Topic:
typedef sequence with user defined objects
"developmm@[EMAIL PR  2007-12-05 01:27:28 
Re: typedef sequence with user defined objects
Mark Woyna <woyna@[EMA  2007-12-05 06:42:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 13:16:13 CDT 2008.