Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / CORBA / December 2007

Tip: Looking for answers? Try searching our database.

typedef sequence with user defined objects

Thread view: 
developmm@gmail.com - 05 Dec 2007 09:27 GMT
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.
Mark Woyna - 05 Dec 2007 14:42 GMT
On Dec 5, 3:27 am, "develo...@gmail.com" <develo...@gmail.com> wrote:
> Hi i'm quite new to corba.
> I need to implement Add.idl, but i can't find something similar on the
[quoted text clipped - 27 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.