Boost logo

Boost :

From: Iain Hanson (Iain.Hanson_at_[hidden])
Date: 2005-03-04 10:16:34


On Thu, 2005-03-03 at 22:28 +0000, Jarl Lindrud wrote:
> Iain Hanson <Iain.Hanson <at> videonetworks.com> writes:
> >
[snip]

> You're making my point for me. For something quick and dirty, who is going to
> want to type all that out? And before I do, I have to learn about IDL, _var
> types, safe downcasts, factories, CORBA::string's, etc, while in the back of my
> mind there's the nagging suspicion that I've missed some subtle detail
> somewhere.

I hardly find 5 lines of code onerous. And it is easy to wrap up part of
it in a template. Quick and dirty may be something you do to learn how
to do something. But AFAIK, not something we create boost libraries for.
IDL is what gives you type safety, something we usually appreciate in
C++.

> And whoever will be looking at my code needs to learn these things as
> well.

This is something that never fails to amaze me. Building distributed
systems is hard to do correctly. It is very similar to the difficulty
with threaded systems but the issues are subtly different and I think
harder in distributed systems. If you can't learn a few conventions in
half a day, then you probably have no business trying to build such
systems.

I probably spend half of my working life fixing systems that have been
quickly hacked and then put into production. CORBA /EJB both have
marketed themselves as the easy and safe way to write distributed
systems and they are not. They are easy to write bad systems in.

What you are proposing is an easier way to write even worse systems.

> I also have to modify the build process to handle the IDL files, and then
> find an ORB to build and link to. None of this is difficult, but I personally
> find it rather cumbersome, and above all, for my situation it's just plain
> unnecessary. All I wanted to do was to make a couple of remote calls between two
> C++ programs! Something along these lines seems to me much more proportional to
> the task at hand:

You already have to link to the serialization library that you have had
to build. I don't understand the difference. And your user needs to
understand the trade-offs with each archive format.

>
> // server
>
> RCF_BEGIN(I_Echo, "I_Echo")
> RCF_METHOD_R1(std::string, echo, std::string);
> RCF_END(I_X);
>
> struct Echo
> {
> void std::string echo(std::string s) { return s; }
> };
>
> int main()
> {
> RCF::RcfServer server(50001);
> server.bind<I_Echo,Echo>();
> server.start();
> return 0;
> }
>
> // client
>
> RCF_BEGIN(I_Echo, "I_Echo")
> RCF_METHOD_R1(std::string, echo, std::string);
> RCF_END(I_Echo);
>
> int main()
> {
> std::cout << RcfClient<I_Echo>("localhost", 50001).echo("ho hum");
> return 0;
> }
>
Your client has 4 lines of code to my 5 and you have macros in your
interface. Not normally considered a good thing. And you have hard coded
the server location. Always considered a bad thing in anything but toy
code.

[snip]

> I guess the argument boils down to this: does anyone write network applications
> for which CORBA-style scaleability is not a requirement? I would think so, but
> maybe I'm wrong.
>

There are low level systems that need to work with sockets. The IETF has
made a pretty good job of making the internet protocols scale. And there
are hard and soft real time projects that need to use sockets.

There are probably a lot of applications that have been built using
sockets that should have used CORBA. Cost has historically been a big
issue with CORBA because commercial implementations have typically ( in
the U.K. ) cost of the order of £3,500 per developer a year and £2,500
per user a year run time.

> RPC's don't scale too well, we both agree on that. But why do you think all
> applications need to scale? If I'm prototyping something, then the last thing in
> the world I need is scaleability, and I certainly wouldn't want the development
> cluttered and slowed because someone has decreed that we must all use CORBA
> because it scales so well.
>

If you are just playing around then I don't have a problem. But I don't
think boost is in the habit of adopting toys. The problem with over
simplified solutions is that a prototype is built, the boss asks for a
few extra features, and before you know it, its rolled out to production
and know one will pay for it to be re-written properly :-(.

> Your position seems to be that programmers should not be afforded the option of
> choosing; they should just bite the bullet and always use CORBA. If they don't
> like that, then they should just avoid networking altogether.

Personally I tend to prefer not letting programmers shoot themselves in
the foot, if I can avoid it. Unfortunately, they ( and I sometimes ) are
incredibly inventive at finding new ways to do so ;-).

/ikh




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk