Base4

From Wikipedia, the free encyclopedia

Base4 is an Free (LGPL) application server for generating, sharing and re-using .Net data layers; this is intended to allow a development team to leverage existing enterprise systems and common functionality instead starting from scratch. It shares many similarities with WinFS but is significantly simplier because it doesn't need to be backward compatible with the whole of the Win32 API stack.

The latest version comes with a schema guesser to help get started very quickly, in fact have a look at Base4 the 15 minute challenge for a video demonstrating just how easy Base4 is now.

Contents

[edit] Features

  • Server has embedded website for Creating, Guessing, Managing and Registering schemas, with no need to learn XML syntax.
  • Client/Server architecture allows many application to act as client of a Base4 Server at the same time. While centralizing common business logic. Business logic is bound typically to a schema and this is the primary unit of re-use in Base4. Each client application picks which schemas it needs to work with, from those that the server makes available, and the server provides a central place which can enforce the business logic for the schema, independently of who is using it.
  • Server support new List<T>() query pattern in preparation for Language Integrated Query
  • Define and generate a fully functional .NET datalayer from either by using the embedded website or by using the simple XML schema
  • Support for inter-schema references, to encourage data-layer sharing and re-use
  • Support for schemas that wrap legacy databases
  • Support for schemas that extend legacy databases
  • Support for Object SQL like queries, and for deep pre-loading of objects using what is called ObjectScoping
  • Application Server supports addins to respond to lifecycle events (some examples are BeforeSave, AfterQuery etc)
  • A core schema with builtin support for Files, Users etc, and a framework for supporting Metadata promotion and demotion to and from files.
  • All generated data-layers provide extensive support for XML including XML persistence, including object Readers and Writers that work directly with XML
  • Automatic .NET Remoting configuration and custom type serialization management

[edit] Planned features: Version 3.0

  • Port from .NET Remoting to a completely REST based architecture
  • Ability to load and save objects via a full URL, not just an object key relative to the current connection
  • Ability to load and save individual object properties via a full URL, independent of their containing Object.

[edit] Code examples

[edit] Connecting to a server

using Base4.Storage;
StorageContext.SetDefault("tcp://Server:@localhost:999/default-store");

[edit] Requesting objects from a server

See the examples here: http://www.base4.net/quickstarts/quickstarts.aspx

FileBase file = StorageContext.FindOne<FileBase>("Name='My File'"); // same as StorageContext.Default.FindOne( … )
if (file != null)
{
        // ID is unique across all files.
        file.Name = "Updated";
        TextWriter writer = file.OpenWriter();
        writer.Write("Hello World");
        writer.Close();
        file.Save(); // Because the file has Base4 will update Version and Modified automatically for the file
}
User user = StorageContext.FindOne<User>("UserName='UserX'"); // Same as ItemContext.FindOne( … )
if (user != null)
{
        // User found do something.
        // Do Work
}

[edit] History

  • Project Started by Alex James and software consulting team -2004
  • Open Sourced -Feb 2005
  • Development of Version2 targeting .Net 2.0 runtime and supporting generics -September 2005
  • Entered Public Beta1 phase -March 2006
  • Entered Public Beta2 phase -April 2006
  • May CTP released - May 2006
  • August CTP released - August 2006
  • Version 2.1 released - October 2006

[edit] External links