Overview
Features
Download
Documentation
Community
Add-Ons & Services
The POCO C++ Libraries Blog

Archive: May, 2007

About things to come

Filed under: Uncategorized by peter at 08:13
<rootPanel name="Test Document">
  <children>
    <form action="/test.xml" method="post">
      <table border="1" cols="3">
        <cell>
          <stack>
            <radioButton name="radio"
                                 checked="false">Click me</radioButton>
            <radioButton name="radio"
                                 checked="true">Or Me!</radioButton>
          </stack>
        </cell>
        <cell>
          <stack>
            <checkBox name="check" checked="true">Check This</checkBox>
            <checkBox name="check">Check That</checkBox>
          </stack>
        </cell>
        <!-- the third column has no value -->
        <cell row="1">
          <stack>
            <label>A Text Area</label>
            <textArea rows="10" cols="30" name="textArea"/>
          </stack>
        </cell>
        <cell col="2">
          <flow>
            <label>A Text Field:</label>
            <textField size="20" maxLength="40" name="textField"/>
          </flow>
        </cell>
      </table>
      <button text="Submit" type="submit"/>
    </form>
  </children>
</rootPanel>

Highly WIP…
Syntax may change :-)

The Quality Without a Name

Filed under: Uncategorized by alex at 22:46

It’s been a while now since I’ve read The Timeless Way of Building by Christopher Alexander, but had no time to comment on it.

The central theme of the book is the quality without a name. Well, since Alexander found no name for it, I certainly shall not attempt to do it either. But this quality is what I have found in C++ language and particularly in POCO. So, if you read my first blog “Why Poco“, you’ll understand it. And this is not really a case for one language/framework or another, because those wars are really pointless – it’s like arguing whether English or German is better language. It depends on time, place and purpose for which you want to use it.

Back to the book – contrary to what I have expected to find – the book on patterns – I have found it, more than anything else, to be a book about agile development with patterns. Both those concepts are intertwined throughout the book, hand-in-hand and indivisible from each other. This was a true revelation to me. While the software pattern community originates from Alexander’s work, I have not found references to it within the agile community. There may be some that I have missed. Or, it may just be that some guys have independently discovered in software engineering the very same thing Alexander has discovered in architecture. At any rate, it is now clear to me that both concepts are major and equally important aspects of architecture, software engineering and probably everything else there is (contrary to the commonly held belief that it’s actually 42 :-) ).

An interesting point Alexander makes to demonstrate how deeply patterns and the related concepts (not invented, but created, discovered and repeatedly used in a different way) are embedded into our world is by claiming that every individual actually creates the language anew. Yes, even the language we speak every day. We do not learn those, but every individual creates it’s own, slightly different version of it by imitating the sounds heard and connecting them to surrounding concepts. For example, people who have read my previous blog posts will have no trouble recognizing who is writing this one without looking at the signature under it. Why is that? Because I write it in my own language which is really close to what we commonly call English. But did Shakespeare and Hemingway write in the same language as I do? (Obviously not, otherwise crowds would cause a denial of service on this server :-) ).

POCO is different from similar frameworks, although they’re all written in the same language (just another proof that libraries are languages in their own right). But it goes even deeper than that – when a new component shows up in POCO, somehow I can tell who wrote the thing. We all write in the same programming language, same library, following the same style guidelines, yet there is a subtle difference that can be detected immediately.

All in all, excellent book with deep and universal insights, really easy read, highly recommended.

The State of Data::ODBC

Filed under: Uncategorized by alex at 12:17

For those folks who have expressed interest in Data library, I’ve been spending some time these days with it and here is the current state of the affairs:

- I found a couple of bugs (logged in SF):

1723148
1724388

Drivers passing all tests:

Windows: MS Access, DB2, Oracle, MySQL, PostgreSQL, SQLServer, SQLite3

Linux (unixODBC): PostgreSQL, MySQL

If you are running on Linux, I strongly recommend to check out the recent SVN. Windows users should have no trouble with either 1.3 release archive or SVN code.

On Linux, FreeTDS connects to MS SQLServer but unfortunately bombs right on the barebone ODBC test, which likely means that the driver is either buggy or nonconformant (barebone ODBC test runs pure ODBC API calls without going through Data library). If anyone can find some time to track down what’s going wrong there, it will be appreciated. Given the amount of components involved (OS, ODBC driver manager, ODBC driver, database) it is practically impossible to test every combination, but we strive to have the most common cases covered.

In the meantime , I am working on stored procedure call support, configurable internal storage containers, DateTime binding etc for 1.3.1.

Until later,

Alex

POCO Kick-Start Trainings

Filed under: News by guenter at 16:41

Are you planning a POCO based project or are you already in the middle of it and want to
receive expert knowledge face-to-face?

Here is what Peter Thulin, Technical Lead at TAC said about a recent training:

“With the POCO Kick-Start Training we received expert knowledge directly from one of POCO’s developers. Through the training we learned how to utilize the POCO C++ Libraries in the best possible way to cover our requirements. Through discussions with the expert from Applied Informatics we were able to optimize our software design.”

You can have that advantage, too!

From July 1 to August 30 we will tour around Europe and the USA to deliver 20 on-site POCO Kick-Start Trainings.

In a one day Kick-Start Training we’ll answer all of your questions, show you tips and tricks and
share our passion in POCO with you.

  • learn about all the features and functionality provided by the POCO C++ Libraries
  • get expert advice on how to design your POCO-based application for maximum performance and scalability
  • have all your POCO-related questions answered directly from one of POCO’s authors
  • discuss your software design with an expert from the POCO development team so that it utilizes the POCO C++ Libraries in the best possible ways

The schedule of the tour is up to you. First come — first serve.

If you want the tour to stop at your site…
… invest the special-offer training fee of only EUR 780, US-$ 1100 per day plus our travel expenses.

Reserving a training day is very simple…
… first come — first serve. When the 20 training days are reserved, the tour plan is full. On August 30, this special offer ends. Afterwards the regular training fees are in effect.

Interested? Contact Gerhard Treffner at Applied Informatics for more information.
See you at your site!

Events and Delegates – or fun with templates

Filed under: Uncategorized by peter at 09:59

Were you ever in a situation where you wrote a piece of code, used it, loved it and half a year later you use it again and well, somehow your expectations have risen?
That happened to me with the events of POCO.
If you used them, you are probably famliar with that code:

Poco::BasicEvent<const std::string> ENameChanged;
Poco::BasicEvent<const std::pair<Address, Address> > EAddressChanged;
// first is old, 2nd is new

[...]

void PersonMonitor::add(Person& p)
{
    p.ENameChanged += Poco::Delegate<PersonMonitor, const std::string>(
        this, &PersonMonitor::onNameChanged);
    p.EAddressChanged += Poco::Expire<const std::pair<Address, Address> >(
        (Poco::Delegate<PersonMonitor, const std::pair<Address, Address> >(
            (this, &PersonMonitor::onAddressChanged), 1000);
}

Actually a lot of code just to add a delegate to an event. You need to know the type of the argument and the type of the receiver object. And then you have to wrap an expire object around the delegate only to tell it that the registration should expire in 1000 millisecs. For my taste that’s too much typing work. But it’s a template object, so you always have to specify the type.
But what if you’d use template functions?

template <class TObj, class TArgs>
static Delegate<TObj, TArgs> delegate(
    TObj* pObj,
    void (TObj::*NotifyMethod)(const void*, TArgs&))
{
    return Delegate<TObj, TArgs>(pObj, NotifyMethod);
}

template <class TObj, class TArgs>
static Expire<TArgs> delegate(
    TObj* pObj,
    void (TObj::*NotifyMethod)(const void*, TArgs&),
    Timestamp::TimeDiff expireMillisecs)
{
    return Expire<TArgs>(
        Delegate<TObj, TArgs>(pObj, NotifyMethod),
        expireMillisecs);
}

Now the compiler can determine the type of TObj and TArg automatically from the method parameters:

void PersonMonitor::add(Person& p)
{
    using Poco::delegate;
    p.ENameChanged    += delegate(this, &PersonMonitor::onNameChanged);
    p.EAddressChanged += delegate(this, &PersonMonitor::onAddressChanged, 1000);
}

Having fixed that, I took another look at the method signature of the callback methods.
Prior the method signature was fixed to:

void method(const void* pSender, TArg& ref)

I hardly ever use the sender parameter but other’s might.
So the goal was to make

  • the sender parameter optional, i.e. accept method signature with/without sender
  • also allow to add static methods (e.g.: C functions)
  • be fully backwards compatible

Suffice to say, I succeeded. I won’t post the code here because it would be too much text.

Watch out for POCO 1.3.1 which will contain these extensions :-)

What’s Your Cup of Java?

Filed under: News by alex at 03:54

Interesting things are happening. While Steve Jobs, explaining why iPhone comes Java-less, says: “Java’s not worth building in. Nobody uses Java anymore. It’s this big heavyweight ball and chain.”, on Artima some folks are lamenting about their frustration with Java ME.

In the mean time, Symbian goes POSIX.

And last but not least: the last two Dr Dobbs magazines, came with an enclosed leaflet inviting reader to try out Sun Studio and test C++ skills.

So, what’s your cup of java?

POCO Data is Available

Filed under: News by guenter at 15:47

POCO Data is now available for download. This is the first release of Data, and in order to get this release out sooner, some planned features are still missing (full ODBC Unicode support on Windows, DateTime support).
Nevertheless, I am quite happy with the result for now, and hope you will be too.

The documentation has been updated and includes a User Guide. Samples are available as well.

Special thanks to Alex for working extra hours last night to get the release out ;-)

POCO 1.3 is Out!

Filed under: News by guenter at 19:30

I am happy to announce the official release and availability of POCO 1.3!

Here’s a summary of what is new in 1.3:

  • HashMap and HashSet classes (Foundation)
  • Tuple class template (Foundation)
  • SharedMemory class (Foundation)
  • FileStream, FileInputStream, FileOutputStream classes that support Unicode (UTF-8) filenames on Windows (Foundation)
  • improvements and bugfixes in the Net library, mostly HTTP
  • DynamicAny class (Foundation)
  • improvements to NetworkInterface class (Net)
  • Condition class, implementing POSIX condition variable-style thread synchronization (Foundation)
  • upgraded to PCRE 7.1 (Foundation)
  • improved Unicode/UTF-8 support
  • NodeAppender class for faster DOM tree creation (XML)
  • Checksum class (Foundation)
  • lots of bugfixes and other improvements – please see the CHANGELOG for details

The detailed changelog can be found here.

Thanks to everyone who contributed to this release, by sending code, bug reports or feature requests.

For those of you waiting for POCO Data, this will be released later this week, as Alex and I need to fix some more things.

I hope you’ll like it.

Günter (now going for a beer to celebrate the release)

POCO 1.3 Snapshot Available

Filed under: News by guenter at 18:48

Since yesterday’s post was lost due to the server failure, here is the announcement again:

A prerelease snapshot of the upcoming POCO 1.3 release is now available for download from Sourceforge.

The release is now basically feature complete; the only thing missing from the snapshot is the Data library, which will be part of the final release, hopefully next week, as promised.

For a list of what’s new in 1.3, see the CHANGELOG.

A Zip file containing the reference documentation is available here.

Server Failure

Filed under: News by guenter at 18:46

Yesterday, at around 8 pm CEST, the server that hosts this website had a hardware failure, which caused this site to become offline until around today, 6:30 pm. Unfortunately, any weblog and forum entries made yesterday have not been backed up and are lost. We are sorry for the inconvenience. This site is served by one of our ISPs machines, so there is nothing we could do about this outtage.