Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ Middleware Writer

Reply
Thread Tools

C++ Middleware Writer

 
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-04-2012
Shalom

Can you give me some suggestions to improve the
C++ Middleware Writer? http://webEbenezer.net

Thanks,
Brian
 
Reply With Quote
 
 
 
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-07-2012

Perhaps you will say what you find clear or confusing about
the site. Someone mentioned this page

http://webEbenezer.net/build_integration.html

was like a "foreign language." Maybe if you feel the same
you could make a suggestion. There's also a lot of open-
source code available on that page and from the on line
code generator. Any of that could be discussed.

In the Name of the G-d of Abraham, Isaac, and Israel,
thank you for your help.
 
Reply With Quote
 
 
 
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-17-2012

This file,
http://webEbenezer.net/misc/cmwAmbassador.cc

has 338 lines and 11 functions at the moment.
Most of the functions are less than 20 lines
long, but the constructor is 104 lines long.
The ctor has the event loop. Is it too long?


 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      08-17-2012
On 8/17/2012 1:03 PM, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> This file,
> http://webEbenezer.net/misc/cmwAmbassador.cc
>
> has 338 lines and 11 functions at the moment.
> Most of the functions are less than 20 lines
> long, but the constructor is 104 lines long.
> The ctor has the event loop. Is it too long?


The ctor is difficult to read. A bunch of local variables. A bunch of
weird macros (FD_ZERO, FD_SET - can't you do initialization of your
variables without those?). And above all - the infinite loop that after
a minute of looking at it was *unclear how or where it terminates*.

Perhaps I'm going to sound strange, but it always seemed to me that
c-tors should be short and sweet, and all other processing ought to be
given to other functions, split into logical areas (you have three 'try'
blocks in that loop, each could probably be in its own function), and
called from the 'init' kind of function... <shrug> But that's a style
topic, of course, just like the size of a function...

V
--
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-17-2012
On Friday, August 17, 2012 1:33:13 PM UTC-4, Victor Bazarov wrote:
> On 8/17/2012 1:03 PM, (E-Mail Removed) wrote:
>
> > This file,

>
> > http://webEbenezer.net/misc/cmwAmbassador.cc

>
> >

>
> > has 338 lines and 11 functions at the moment.

>
> > Most of the functions are less than 20 lines

>
> > long, but the constructor is 104 lines long.

>
> > The ctor has the event loop. Is it too long?

>
>
>
> The ctor is difficult to read. A bunch of local variables. A bunch of
>
> weird macros (FD_ZERO, FD_SET - can't you do initialization of your
>
> variables without those?). And above all - the infinite loop that after
>
> a minute of looking at it was *unclear how or where it terminates*.
>


That's the event loop of a server. It doesn't terminate
unless there's an exception at a high level.

 
Reply With Quote
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-17-2012
On Friday, August 17, 2012 2:03:27 PM UTC-4, Scott Lurndal wrote:
>
> FD* macros are part of the defined API for the select system call.
>
>
>
> that said, the op should probably use poll(2) instead of select(2).


It has been several years since I considered using poll
and I don't remember why I didn't use it. It may have
been it wasn't as portable as select.
 
Reply With Quote
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-18-2012
On Friday, August 17, 2012 1:03:27 PM UTC-5, Scott Lurndal wrote:
FD* macros are part of the defined API for the select system call. that said, the op should probably use poll(2) instead of select(2).

I switched to using poll now. Doing so shaved 15 lines
from the program and about 500 bytes off the size of the
executable on Linux. It would have been 16 lines but I
needed this
#define poll WSAPoll
on Windows.

It looked like I would also need
#define pollfd WSAPOLLFD
but at least here on Windows 7 that isn't needed.

I haven't checked any run time performance results, but
it is working on Linux and Windows. The constructor is
now 96 lines.
 
Reply With Quote
 
Öö Tiib
Guest
Posts: n/a
 
      08-21-2012
On Sunday, August 5, 2012 2:06:25 AM UTC+3, (unknown) wrote:
> Shalom
>
>
>
> Can you give me some suggestions to improve the
>
> C++ Middleware Writer? http://webEbenezer.net
>


Looking at your site it seems that your software generates serialization code automatically ... but what code? IOW i miss some easy explanation what serialization problems exactly that generated stuff addresses and how and inwhat "tier" of yours. Also ... what problems it ignores or fails to address and leaves up to users? Our FAQ is good source of inspiration how to discuss it in depth (http://www.parashift.com/c++-faq-lit...ation.html).If boost::serialization is 1.5 times slower or quicker does not really matter much, since i don't use that either.

For me the key problem of serialization (that is often unsolved) is that software evolves. At least successful software. With it evolves the data thatit has to say (or serialize).

On the other hand the users of software do not usually evolve as quick as the software. Some tend to keep old version for decades. More so when the data is serialized into some file to be archived by user for a case. Rather old version gems may turn out of user's archives and become suddenly actual such way. Software developers who might make software that exchanges data (serializes/deserializes) with your software are no different from other users. Here will always be someone posting that he uses past millennium compiler Visual C 6.0 and has some trouble.

Therefore there is huge desire to keep newer versions compatible with olderversions (and third party auxiliaries). That is quite complex problem. Forexample XML-based serialization may solve it partially so that older software just ignores unknown tags and attributes that it does not know of and newer version assumes some defaults if the tags and attributes are missing.
 
Reply With Quote
 
woodbrian77@gmail.com
Guest
Posts: n/a
 
      08-21-2012
On Monday, August 20, 2012 9:12:41 PM UTC-4, Öö Tiib wrote:

>
> Looking at your site it seems that your software generates serialization code automatically ... but what code? IOW i miss some easy explanation whatserialization problems exactly that generated stuff addresses and how and in what "tier" of yours. Also ... what problems it ignores or fails to address and leaves up to users? Our FAQ is good source of inspiration how to discuss it in depth (http://www.parashift.com/c++-faq-lit...alization.html). If boost::serialization is 1.5 times slower or quicker does not really matter much, since i don't use that either.
>


The documentation needs work.

The generated code is based on user input. This input:

http://webEbenezer.net/misc/cmw.req
http://webEbenezer.net/misc/remote.mdl

results in this output:

http://webEbenezer.net/misc/remote_m...s_middle.cg.hh
http://webEbenezer.net/misc/remote_m...s_middle.cg.cc


I've discussed support for multiple versions here and
in other forums and agree that it's a difficult problem.


To the best of my knowledge the C++ Middleware Writer
was the first on line code generator. For years there's
also been an on line PHP code generator. Lately I
noticed an on line Java code generator --
http://www.springfuse.com




 
Reply With Quote
 
Werner
Guest
Posts: n/a
 
      08-21-2012
On Friday, August 17, 2012 7:03:59 PM UTC+2, (unknown) wrote:

> The ctor has the event loop. Is it too long?


Personally, I don't think it's intuitive (and its
contra-convention) to put the event loop in the
constructor. I would rather perform all
initialization in the constructor, and have the
user call a member function to commence the service.

try
{
CmwAmbassador cmwAmbassador;
cmwAmbassador.run();
}
catch( std::exception const &ex )
{
//...
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Version 1.11 of C++ Middleware Writer now on line Brian C++ 3 02-28-2010 04:27 AM
C++ Middleware Writer version 1.10 is now on line Brian C++ 0 11-29-2009 07:43 AM
New version of C++ Middleware Writer now on line woodbrian77@gmail.com C++ 1 05-20-2009 06:02 PM
New version of C++ Middleware Writer available coal@mailvault.com C++ 1 04-07-2009 05:49 PM
Isn't DataGrid.Render(writer) supposed to automatically call RenderBeginTag(writer) and RenderEndTag(writer)? Henri ASP .Net Building Controls 1 07-13-2004 10:27 PM



Advertisments