|
Boost : |
From: Martin Schulz (Martin.Schulz_at_[hidden])
Date: 2008-04-01 06:10:01
> For the google summer of code 2008, I wish to build a Cross
> Platform Remote Method Invocation Framework for C++ using Boost.Asio,
> similar to Java's remote method invocation (RMI). I will provide some
macro
> definitions to create the proxy code.
What does cross-platform mean here if you can only make boostified C++
talk to boostified C++?
Why invent the wheel all over again? Why not stick to some already
existing solutions like Corba or such?
Admittedly, the C++ language binding of Corba is just horrible nowadays
and needs to be revisited. So in my eyes, it would be much more
rewarding to work out a modern, boostified C++ language binding to an
already existing RPC framework like Corba (or the like).
> account.h
> --------------
> DECLARE_BEGIN_PROXY(account)
> DECLARE_METHOD_1(deposit, void, double);
> DECLARE_METHOD_0(get_balance, double);
> DECLARE_END;
That would effectively go to an idl file. The advantage is that the same
idl file would also be usable for C, Java, C# or whatever.
> Server Code
> -----------------
> account acc = new account("Foo", 250);
> Server s = new server(server::TCP, 19000);
> s.attach("Foo", acc);
> s.run();
>
> Client Code
> ----------------
> account_proxy acct = account_proxy::get_proxy("172.25.44.195",
server::TCP,
> 19000, "Foo");
> acct.deposit(100);
> double balance = acct.get_balance();
Something similar is needed in any of those frameworks and may be found
as introductory example in many books. But how will client and server
get to know each other? How will they be started? What about dynamic
port numbers? What about authentication? Authorization? Lifetime
management for proxy and/or server objects?
If you just want some fun and do your own implementation, just go ahead
and have fun. But if you want a broadly useful RPC mechanism for modern
C++, get out some literature about existing frameworks, and think about
why e.g. Corba is such a complex monster. You will probably observe that
most pieces do indeed have their use cases. I assume that people behind
Corba did probably invest much more brain power than most of us (at
least me personally) would be willing to do.
Have fun,
Martin.
-- Dr. Martin Schulz (schulz_at_[hidden]) Senior R&D Engineer Synopsys GmbH Karl-Hammerschmidt-Str. 34 D-85609 Dornach, Germany Munich office: +49 (89) 993-20203 Home office: +49 (721) 6099511 http://www.synopsys.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk