Click here to Skip to main content
15,885,754 members
Articles / Programming Languages / C#

Using a Database Over a Webservice

Rate me:
Please Sign up or sign in to vote.
4.43/5 (5 votes)
29 May 20073 min read 48.5K   539   44  
This article shows an example implementation of a database used over a Web-Service
/* Copyright (C) 2004 - 2007  db4objects Inc.  http://www.db4o.com */

using Db4objects.Db4o.Types;

namespace Db4objects.Db4o.Types
{
	/// <summary>factory and other methods for database-aware collections.</summary>
	/// <remarks>factory and other methods for database-aware collections.</remarks>
	public interface IDb4oCollections
	{
		/// <summary>creates a new database-aware linked list.</summary>
		/// <remarks>
		/// creates a new database-aware linked list.
		/// <br /><br />Usage:<br />
		/// - declare a <code>java.util.List</code> variable in your persistent class.<br />
		/// - fill this variable with this method.<br /><br />
		/// <b>Example:</b><br /><br />
		/// <code><pre>
		/// class MyClass{
		/// List myList;
		/// }
		/// MyClass myObject = new MyClass();
		/// myObject.myList = objectContainer.ext().collections().newLinkedList();</pre></code><br /><br />
		/// </remarks>
		/// <returns>
		/// 
		/// <see cref="IDb4oList">IDb4oList</see>
		/// </returns>
		/// <seealso cref="IDb4oList">IDb4oList</seealso>
		IDb4oList NewLinkedList();

		/// <summary>creates a new database-aware HashMap.</summary>
		/// <remarks>
		/// creates a new database-aware HashMap.
		/// <br /><br />
		/// This map will call the hashCode() method on the key objects to calculate the
		/// hash value. Since the hash value is stored to the ObjectContainer, key objects
		/// will have to return the same hashCode() value in every VM session.
		/// <br /><br />
		/// Usage:<br />
		/// - declare a <code>java.util.Map</code> variable in your persistent class.<br />
		/// - fill the variable with this method.<br /><br />
		/// <b>Example:</b><br /><br />
		/// <code><pre>
		/// class MyClass{
		/// Map myMap;
		/// }
		/// MyClass myObject = new MyClass();
		/// myObject.myMap = objectContainer.ext().collections().newHashMap(0);</pre></code><br /><br />
		/// </remarks>
		/// <param name="initialSize">the initial size of the HashMap</param>
		/// <returns>
		/// 
		/// <see cref="IDb4oMap">IDb4oMap</see>
		/// </returns>
		/// <seealso cref="IDb4oMap">IDb4oMap</seealso>
		IDb4oMap NewHashMap(int initialSize);

		/// <summary>creates a new database-aware IdentityHashMap.</summary>
		/// <remarks>
		/// creates a new database-aware IdentityHashMap.
		/// <br /><br />
		/// Only first class objects already stored to the ObjectContainer (Objects with a db4o ID)
		/// can be used as keys for this type of Map. The internal db4o ID will be used as
		/// the hash value.
		/// <br /><br />
		/// Usage:<br />
		/// - declare a <code>java.util.Map</code> variable in your persistent class.<br />
		/// - fill the variable with this method.<br /><br />
		/// <b>Example:</b><br /><br />
		/// <code><pre>
		/// class MyClass{
		/// Map myMap;
		/// }
		/// MyClass myObject = new MyClass();
		/// myObject.myMap = objectContainer.ext().collections().newIdentityMap(0);</pre></code><br /><br />
		/// </remarks>
		/// <param name="initialSize">the initial size of the HashMap</param>
		/// <returns>
		/// 
		/// <see cref="IDb4oMap">IDb4oMap</see>
		/// </returns>
		/// <seealso cref="IDb4oMap">IDb4oMap</seealso>
		IDb4oMap NewIdentityHashMap(int initialSize);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United Arab Emirates United Arab Emirates
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions