16

Do you know of well designed open source applications that are instructive to analyse?

Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality.

andreas buykx
  • 12,608
  • 10
  • 62
  • 76
  • I'd be interested to see this too. I'm pretty much convinced that it's impossible to actually code good OO in C++ due to lack of GC and the weight of new classes and the nature of C++ programmers to resist constant memory allocations/deallocations (new objects). Most OO programmers I know agree. – Bill K Oct 24 '08 at 16:52
  • @BillK I suggest you pick up a [good book about C++](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). C++ has RAII and you don't dynamically allocate stuff in C++ unless you absolutely have to. –  Jun 03 '12 at 14:20
  • Not dynamically allocating stuff is the kind of thing that is the opposite of OO programming. It's not that OO programming is impossible in C++ or anything, it's just that everything in C++ encourages you to do things in a less-OO way. It can be overcome, but most C++ programmers seem to give up and come up with a hybrid solution that has pieces of OO but doesn't really commit. If you do go full-OO, you might as well go with Java because your solution will probably be faster and definitely cleaner (heap allocations, the heart of OO programming, are not C++'s best attribute) – Bill K Jun 04 '12 at 15:46

3 Answers3

4

If you include well designed open source libraries that are instructive to analyse, have a look at Boost.

About persistence / serialization (not relational mapping though), have a look at Boost Serialization, you might find nice ideas!

"...one of the most highly regarded and expertly designed C++ library projects in the world." — Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

"Item 55: Familiarize yourself with Boost." — Scott Meyers, Effective C++, 3rd Ed.

"The obvious solution for most programmers is to use a library that provides an elegant and efficient platform independent to needed services. Examples are BOOST..." — Bjarne Stroustrup, Abstraction, libraries, and efficiency in C++

Sébastien RoccaSerra
  • 16,731
  • 8
  • 50
  • 54
1

While this doesn't fit your specific requirements (it's not a business app for a start), I think that OGRE 3D is a great example of an open source C++ project.

jonnii
  • 28,019
  • 8
  • 80
  • 108
1

V8 javascript engine is said to be very well engineered. http://code.google.com/p/v8/

Google Chrome also has an interesting architecture and high quality code base. http://code.google.com/chromium/

Both are open source, under BSD-like license.

Paweł Hajdan
  • 18,074
  • 9
  • 49
  • 65