Db4o reference documentation accompanies theoretical material with example code, which can be used for the material evaluation and better understanding.
The examples are provided in java, c# and VB.NET. In the online version, you can use filters on the right pane to display the relevant content. Offline version provides the content depending on the downloaded version of db4o.
Most of the examples are console applications except for those clearly mentioning the environment (web-applications, windows forms etc.).
.Net examples are .NET2.0 compatible.
The in-text code snippets are mainly used to show the syntax of a particular method. The following variables are used:
objectContainer
- references and open
ObjectContainer/IObjectContainer or ObjectClient/IobjectClient. For more
information see Object Container and
Embedded.
configuration
variable is used to reflect
Configuration object. See Configuration.
The examples usually show only the method code demonstrating the functionality discussed. In this case, additional code (opening and closing database methods, listing results, global variable definitions) and persistent class definitions are not visible. In order to see them you can download the whole example as a *.zip file using the button in the top-right corner of the example code block. Note: usually the *.zip file contains all the examples for the current topic.
In the majority of the examples, objectContainer is opened and closed in each method. This is done to keep examples atomic. In the real-world application, the best technique would be to open an objectContainer on the first request and keep it open for the application lifetime.
The downloaded code can be easily used to run the examples.In Visual Studio 2005: