Commits

Tuukka Norri committed 19ca1ed

Made BXDatabaseObjectModel and BXDatabaseObjectModelStorage public and updated the documentation accordingly

Comments (0)

Files changed (19)

BaseTen.xcodeproj/project.pbxproj

 		535661D60F025DD800920008 /* NSPredicate+BaseTenAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 535661D00F025DD800920008 /* NSPredicate+BaseTenAdditions.h */; };
 		535661D90F02603600920008 /* BXLocalizedString.h in Headers */ = {isa = PBXBuildFile; fileRef = 535661D70F02603600920008 /* BXLocalizedString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		535661DA0F02603600920008 /* BXSafetyMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 535661D80F02603600920008 /* BXSafetyMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		535736C50F3283C200DB3D0B /* BXDatabaseObjectModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 535736C30F3283C200DB3D0B /* BXDatabaseObjectModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		535736C50F3283C200DB3D0B /* BXDatabaseObjectModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 535736C30F3283C200DB3D0B /* BXDatabaseObjectModel.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		535736C60F3283C200DB3D0B /* BXDatabaseObjectModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 535736C40F3283C200DB3D0B /* BXDatabaseObjectModel.m */; };
-		535736CB0F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 535736C90F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.h */; };
+		535736CB0F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 535736C90F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		535736CC0F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 535736CA0F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.m */; };
 		535B3E1E1038146500A5FB7E /* libpcre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B3E1D1038146500A5FB7E /* libpcre.a */; };
 		535F23570E8A8D4900311CB5 /* BXPGArrayExpressionValueType.h in Headers */ = {isa = PBXBuildFile; fileRef = 535F23550E8A8D4900311CB5 /* BXPGArrayExpressionValueType.h */; };
 		53666D130E1CD8D20028DBEA /* PGTSSchemaDescription.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53666CD40E1CD8D20028DBEA /* PGTSSchemaDescription.mm */; };
 		53666D140E1CD8D20028DBEA /* PGTSTableDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 53666CD50E1CD8D20028DBEA /* PGTSTableDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53666D160E1CD8D20028DBEA /* PGTSTypeDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 53666CD70E1CD8D20028DBEA /* PGTSTypeDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		53671B4B0FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 53671B490FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		53671B4B0FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 53671B490FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		53671B4C0FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 53671B4A0FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.m */; };
 		53680C0E0E59922C00A53B26 /* BXKeyPathParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 53680C0C0E59922C00A53B26 /* BXKeyPathParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53680C0F0E59922C00A53B26 /* BXKeyPathParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 53680C0D0E59922C00A53B26 /* BXKeyPathParser.m */; };
 		53BFE53E0FAF2EFA0004533F /* BXError.m in Sources */ = {isa = PBXBuildFile; fileRef = 53BFE53C0FAF2EFA0004533F /* BXError.m */; };
 		53C6BA8D0E7148B6000E509D /* NSAttributeDescription+BXPGAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 53877E980E26B3F00097C35F /* NSAttributeDescription+BXPGAdditions.m */; };
 		53C7113B0F57636E00C6481F /* BXOpenSSLCompatibility.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 538FA0240F576278005EBFAC /* BXOpenSSLCompatibility.h */; };
+		53C8CC65118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C8CC63118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		53C8CC66118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C8CC64118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53CE796B0E87F29C00D5A310 /* BXPGQueryHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CE79690E87F29C00D5A310 /* BXPGQueryHandler.h */; };
 		53CE796C0E87F29C00D5A310 /* BXPGQueryHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 53CE796A0E87F29C00D5A310 /* BXPGQueryHandler.m */; };
 		53CE94050E64119500063193 /* BXPGExpressionVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CE94030E64119500063193 /* BXPGExpressionVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53CE950E0E658CE400063193 /* BXPGExpressionValueType.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CE950C0E658CE400063193 /* BXPGExpressionValueType.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53CE950F0E658CE400063193 /* BXPGExpressionValueType.m in Sources */ = {isa = PBXBuildFile; fileRef = 53CE950D0E658CE400063193 /* BXPGExpressionValueType.m */; };
 		53CE953B0E658E2600063193 /* BXPredicateVisitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 53526E090E5D70EB00B67550 /* BXPredicateVisitor.m */; };
-		53D0482110021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D0481F10021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		53D0482110021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D0481F10021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		53D0482210021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53D0482010021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.mm */; };
 		53D672BA0E55CD5F00D8A5F8 /* PGTSProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = 53666CC80E1CD8D20028DBEA /* PGTSProbes.d */; };
 		53D672BC0E55CD6200D8A5F8 /* PGTSQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 53666CCA0E1CD8D20028DBEA /* PGTSQuery.m */; };
 		53BDBBFC0C306DA6007F63A1 /* BXConstantsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXConstantsPrivate.h; path = Sources/BXConstantsPrivate.h; sourceTree = "<group>"; };
 		53BFE53B0FAF2EFA0004533F /* BXError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXError.h; path = Sources/BXError.h; sourceTree = "<group>"; };
 		53BFE53C0FAF2EFA0004533F /* BXError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXError.m; path = Sources/BXError.m; sourceTree = "<group>"; };
+		53C8CC63118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXDatabaseObjectModelStoragePrivate.h; path = Sources/BXDatabaseObjectModelStoragePrivate.h; sourceTree = "<group>"; };
+		53C8CC64118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXDatabaseObjectModelPrivate.h; path = Sources/BXDatabaseObjectModelPrivate.h; sourceTree = "<group>"; };
 		53CE79690E87F29C00D5A310 /* BXPGQueryHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGQueryHandler.h; path = Sources/BXPGQueryHandler.h; sourceTree = "<group>"; };
 		53CE796A0E87F29C00D5A310 /* BXPGQueryHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXPGQueryHandler.m; path = Sources/BXPGQueryHandler.m; sourceTree = "<group>"; };
 		53CE94030E64119500063193 /* BXPGExpressionVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGExpressionVisitor.h; path = Sources/BXPGExpressionVisitor.h; sourceTree = "<group>"; };
 			isa = PBXGroup;
 			children = (
 				535736C90F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.h */,
+				53C8CC63118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h */,
 				535736CA0F333CCD00DB3D0B /* BXDatabaseObjectModelStorage.m */,
 				535736C30F3283C200DB3D0B /* BXDatabaseObjectModel.h */,
+				53C8CC64118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h */,
 				535736C40F3283C200DB3D0B /* BXDatabaseObjectModel.m */,
 				53671B490FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.h */,
 				53671B4A0FABAC5F002FD0B4 /* BXDatabaseObjectModelXMLSerialization.m */,
 				53D0482110021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h in Headers */,
 				53617F271035AF8A003CE4F5 /* libpq-fe.h in Headers */,
 				53617F7F1035B89D003CE4F5 /* BXPGSQLScanner.h in Headers */,
+				53C8CC65118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h in Headers */,
+				53C8CC66118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Documentation/BaseTen-class-hierarchy.dot

+digraph baseten_class_hierarchy
+{
+	compound=true;
+	rankdir="RL";
+	
+	node [shape = box]
+		NSObject
+		NSProxy
+		NSException
+		BXDatabaseContext
+		BXDatabaseObject
+		BXDatabaseObjectID
+		BXException
+
+        BXDatabaseObjectModel
+        BXDatabaseObjectModelStorage
+		
+		BXAbstractDescription
+		BXEntityDescription
+		BXPropertyDescription
+		BXAttributeDescription
+		BXRelationshipDescription
+		
+		BXContainerProxy
+		BXArrayProxy
+		BXSetProxy;
+		
+	node [shape = diamond]
+		NSObjectProtocol [label = NSObject]
+		BXDatabaseContextDelegate;
+		
+	edge [arrowhead = onormal]
+		NSObject -> NSObjectProtocol 
+		NSProxy -> NSObjectProtocol
+		BXDatabaseContext -> NSObject
+		BXDatabaseObject -> NSObject
+		BXDatabaseObjectID -> NSObject
+
+        BXDatabaseObjectModel -> NSObject
+        BXDatabaseObjectModelStorage -> NSObject
+
+		NSException:w -> NSObject
+		BXException -> NSException
+	
+		BXAbstractDescription -> NSObject
+		BXEntityDescription -> BXAbstractDescription
+		BXPropertyDescription -> BXAbstractDescription
+		BXAttributeDescription -> BXPropertyDescription
+		BXRelationshipDescription -> BXPropertyDescription
+	
+		BXContainerProxy -> NSProxy
+		BXArrayProxy -> BXContainerProxy
+		BXSetProxy -> BXContainerProxy
+	
+		BXDatabaseContextDelegate -> NSObjectProtocol;
+}

Documentation/BaseTen-object-relationships.dot

+digraph baseten_relationships 
+{	
+	compound = true;
+	
+	node [shape = box]
+        BXArrayProxy
+        BXDatabaseObjectModel
+        BXDatabaseObjectModelStorage
+		BXEntityDescription
+		BXDatabaseObject
+		BXDatabaseObjectID
+        BXAttributeDescription
+        BXRelationshipDescription
+        BXSetProxy
+        BXDatabaseContext;		
+	
+	node [shape = ellipse]
+		"Object URI"
+		"Owning object"
+        "Column values"
+        "Related objects";
+	
+	BXDatabaseContext -> BXDatabaseObject [arrowtail = normal, arrowhead = normalnormal];	
+    BXDatabaseContext -> BXDatabaseObjectModel [arrowhead = normal];
+
+    BXDatabaseObjectModelStorage -> BXDatabaseObjectModel [arrowtail = normal, arrowhead = normalnormal];
+	BXDatabaseObjectModel -> BXEntityDescription [arrowtail = normal, arrowhead = normalnormal];
+
+	BXArrayProxy -> BXDatabaseObject [arrowhead = normalnormal]
+	
+	BXDatabaseObject -> "Column values" [arrowhead = normalnormal];
+	BXDatabaseObject -> BXDatabaseObjectID:n [arrowhead = normal];
+    BXDatabaseObject -> BXSetProxy [arrowtail = normal, arrowhead = normalnormal];
+	BXSetProxy -> "Related objects" [arrowhead = normalnormal];
+	
+	BXDatabaseObjectID:s -> BXEntityDescription;
+	BXDatabaseObjectID -> "Object URI";
+	
+	BXEntityDescription -> BXAttributeDescription [arrowhead = normalnormal, arrowtail = normal];
+	BXEntityDescription -> BXRelationshipDescription [arrowhead = normalnormal, arrowtail = normal];
+	
+	"Owning object" -> BXArrayProxy [arrowhead = normal, arrowtail = normal];
+}

Documentation/BaseTenClassHierarchy.dot

-digraph baseten_class_hierarchy
-{
-	compound=true;
-	rankdir="RL";
-	
-	node [shape = box]
-		NSObject
-		NSProxy
-		NSException
-		BXDatabaseContext
-		BXDatabaseObject
-		BXDatabaseObjectID
-		BXException
-		
-		BXAbstractDescription
-		BXEntityDescription
-		BXPropertyDescription
-		BXAttributeDescription
-		BXRelationshipDescription
-		
-		BXContainerProxy
-		BXArrayProxy
-		BXSetProxy;
-		
-	node [shape = diamond]
-		NSObjectProtocol [label = NSObject]
-		BXDatabaseContextDelegate;
-		
-	edge [arrowhead = onormal]
-		NSObject -> NSObjectProtocol 
-		NSProxy -> NSObjectProtocol
-		BXDatabaseContext -> NSObject
-		BXDatabaseObject -> NSObject
-		BXDatabaseObjectID -> NSObject
-
-		NSException:w -> NSObject
-		BXException -> NSException
-	
-		BXAbstractDescription -> NSObject
-		BXEntityDescription -> BXAbstractDescription
-		BXPropertyDescription -> BXAbstractDescription
-		BXAttributeDescription -> BXPropertyDescription
-		BXRelationshipDescription -> BXPropertyDescription
-	
-		BXContainerProxy -> NSProxy
-		BXArrayProxy -> BXContainerProxy
-		BXSetProxy -> BXContainerProxy
-	
-		BXDatabaseContextDelegate -> NSObjectProtocol;
-}

Documentation/BaseTenObjectRelationships.dot

-digraph baseten_relationships 
-{	
-	compound=true;
-	
-	node [shape = box]
-		BXEntityDescription
-		BXDatabaseObject
-		BXDatabaseObjectID;
-	
-	node [shape = ellipse]
-		"Object URI";
-		"Owning object" [style = normal]
-			
-	subgraph cluster_fetches
-	{
-		style=invisible;
-		//color=lightgrey;
-		//label="By fetch";
-
-		node [shape = ellipse]
-			"Collection of objects";
-		
-		node [shape = box]
-			BXArrayProxy;
-	}
-	
-	subgraph properties
-	{
-		style=filled;
-		color=lightgrey;
-
-		node [shape = box]
-			BXAttributeDescription
-			BXRelationshipDescription;
-	}
-	
-	subgraph object_contents
-	{
-		style=filled;
-		color=lightgrey;
-
-		node [shape = ellipse]
-			"Column values"
-			"Related objects";
-	}
-	
-	subgraph cluster_database
-	{
-		style=invisible;
-		color=lightgrey;
-	
-		node [shape = box]
-			BXDatabaseContext;		
-	}
-	
-	BXDatabaseContext -> BXDatabaseObject [arrowtail = normal, arrowhead = none];	
-	BXDatabaseContext -> BXEntityDescription [arrowhead = normalnormal];
-
-	//BXDatabaseContext -> BXArrayProxy [style = dashed, arrowhead = none, lhead = cluster_fetches];
-	BXDatabaseContext -> BXArrayProxy [style = dashed, arrowhead = none];
-	BXDatabaseContext -> "Collection of objects" [style = dashed, arrowhead = none];
-	
-	//BXArrayProxy:e -> BXDatabaseObject [arrowhead = normalnormal, ltail = cluster_fetches]
-	BXArrayProxy -> BXDatabaseObject [arrowhead = normalnormal]
-	"Collection of objects" -> BXDatabaseObject [arrowhead = normalnormal]
-	
-	BXDatabaseObject -> "Column values" [arrowhead = normalnormal];
-	BXDatabaseObject -> "Related objects" [arrowhead = none];
-	BXDatabaseObject -> BXDatabaseObjectID:n;
-	BXDatabaseObject -> BXEntityDescription;
-	
-	BXDatabaseObjectID:s -> BXEntityDescription;
-	BXDatabaseObjectID -> "Object URI";
-	
-	BXEntityDescription -> BXAttributeDescription [arrowhead = normalnormal, arrowtail = normal];
-	BXEntityDescription -> BXRelationshipDescription [arrowhead = normalnormal, arrowtail = normal];
-	
-	"Owning object" -> BXArrayProxy [arrowhead = none, arrowtail = normal];
-}

Documentation/images/BaseTen-class-hierarchy.pdf

Binary file modified.

Documentation/images/BaseTen-class-hierarchy.png

Old
Old image
New
New image

Documentation/images/BaseTen-object-relationships.pdf

Binary file modified.

Documentation/images/BaseTen-object-relationships.png

Old
Old image
New
New image

Sources/BXDatabaseContext.h

 - (NSURL *) databaseURI;
 - (BOOL) isConnected;
 
+- (BXDatabaseObjectModel *) databaseObjectModel;
+
 - (BOOL) retainsRegisteredObjects;
 - (void) setRetainsRegisteredObjects:(BOOL)flag;
 

Sources/BXDatabaseContext.m

 #import "BXEnumerate.h"
 #import "BXLocalizedString.h"
 #import "BXDatabaseObjectModel.h"
+#import "BXDatabaseObjectModelPrivate.h"
 #import "BXDatabaseObjectModelStorage.h"
 #import "BXAttributeDescriptionPrivate.h"
 #import "BXError.h"
 {
 	[mDatabaseInterface setLogsQueries: shouldLog];
 }
+
+
+/** \brief The database objectModel for the current database URI. */
+- (BXDatabaseObjectModel *) databaseObjectModel
+{
+	if (! mObjectModel && mDatabaseURI)
+	{
+		NSNumber* port = [mDatabaseURI port];
+		if (! port)
+			port = [mDatabaseInterface defaultPort];
+		
+		NSURL* key = [mDatabaseURI BXURIForHost: nil port: port database: nil username: @"" password: @""];
+		[self setDatabaseObjectModel: [[BXDatabaseObjectModelStorage defaultStorage] objectModelForURI: key]];
+	}
+	return mObjectModel;
+}
 @end
 
 
 	}
 }
 
-- (BXDatabaseObjectModel *) databaseObjectModel
-{
-	if (! mObjectModel && mDatabaseURI)
-	{
-		NSNumber* port = [mDatabaseURI port];
-		if (! port)
-			port = [mDatabaseInterface defaultPort];
-		
-		NSURL* key = [mDatabaseURI BXURIForHost: nil port: port database: nil username: @"" password: @""];
-		[self setDatabaseObjectModel: [[BXDatabaseObjectModelStorage defaultStorage] objectModelForURI: key]];
-	}
-	return mObjectModel;
-}
-
 - (struct update_kvo_ctx) handleWillChangeForUpdate: (NSArray *) givenObjects newValues: (NSDictionary *) newValues
 {
 	NSMutableArray* changedObjects = [NSMutableArray array];

Sources/BXDatabaseContextPrivate.h

 - (void) setCanConnect: (BOOL) aBool;
 - (BOOL) checkErrorHandling;
 - (void) setLastConnectionError: (NSError *) anError;
-- (BXDatabaseObjectModel *) databaseObjectModel;
 
 - (void) setDatabaseObjectModel: (BXDatabaseObjectModel *) model;
 - (void) setDatabaseInterface: (id <BXInterface>) interface;

Sources/BXDatabaseObjectModel.h

 // BXDatabaseObjectModel.h
 // BaseTen
 //
-// Copyright (C) 2009 Marko Karppinen & Co. LLC.
+// Copyright (C) 2009-2010 Marko Karppinen & Co. LLC.
 //
 // Before using this software, please review the available licensing options
 // by visiting http://basetenframework.org/licensing/ or by contacting
 	NSMutableDictionary* mEntitiesBySchemaAndName;
 	BOOL mCanCreateEntities;
 }
-- (id) initWithStorage: (BXDatabaseObjectModelStorage *) storage key: (NSURL *) key;
 - (BXEntityDescription *) entityForTable: (NSString *) tableName inSchema: (NSString *) schemaName error: (NSError **) outError;
 - (BXEntityDescription *) entityForTable: (NSString *) tableName error: (NSError **) outError;
 - (NSArray *) entities: (NSError **) outError;
-- (BOOL) contextConnectedUsingDatabaseInterface: (id <BXInterface>) interface error: (NSError **) outError;
 - (NSDictionary *) entitiesBySchemaAndName: (id <BXInterface>) interface reload: (BOOL) shouldReload error: (NSError **) outError;
-- (void) setCanCreateEntityDescriptions: (BOOL) aBool;
 @end

Sources/BXDatabaseObjectModel.m

 
 #import "BXDatabaseObjectModel.h"
 #import "BXDatabaseObjectModelStorage.h"
+#import "BXDatabaseObjectModelStoragePrivate.h"
 #import "BXEnumerate.h"
 #import "BXEntityDescriptionPrivate.h"
 #import "BXInterface.h"
 #import "BXLogger.h"
 
 
+/** 
+ * \brief The database object model. 
+ * 
+ * A database object model stores the entity descriptions for a database at a certain URI.
+ *
+ * \note This class is thread-safe.
+ * \ingroup baseten
+ */
 @implementation BXDatabaseObjectModel
-- (id) initWithStorage: (BXDatabaseObjectModelStorage *) storage key: (NSURL *) key
-{
-	if ((self = [super init]))
-	{
-		mStorage = [storage retain];
-		mStorageKey = [key retain];
-		mEntitiesBySchemaAndName = [[NSMutableDictionary alloc] init];
-		mCanCreateEntities = YES;
-	}
-	return self;
-}
-
 - (id) init
 {
 	[self doesNotRecognizeSelector: _cmd];
 	[super dealloc];
 }
 
+
+/** 
+ * \brief Entity for a table in the schema \em public
+ */
 - (BXEntityDescription *) entityForTable: (NSString *) name error: (NSError **) outError
 {
 	return [self entityForTable: name inSchema: @"public" error: outError];
 }
 
+
+/** 
+ * \brief Entity for a table in the given schema.
+ * \note Unlike PostgreSQL, leaving \em schemaName unspecified does not cause the search path to be used but 
+ *       instead will search the \em public schema.
+ */
 - (BXEntityDescription *) entityForTable: (NSString *) name inSchema: (NSString *) schemaName error: (NSError **) outError
 {
 	NSMutableDictionary* schemaDict = nil;
 	return retval;
 }
 
+
+/**
+ * \brief All entities found in the database.
+ *
+ * Entities in private and metadata schemata won't be included.
+ * \param outError If an error occurs, this pointer is set to an NSError instance. May be NULL.
+ * \return An NSArray containing BXEntityDescriptions.
+ */
 - (NSArray *) entities: (NSError **) outError
 {
 	NSMutableArray* retval = [NSMutableArray array];
 	return retval;
 }
 
+
+/**
+ * \brief All entities found in the database.
+ *
+ * Entities in private and metadata schemata won't be included.
+ * \param reload Whether the entity list should be reloaded.
+ * \param outError If an error occurs, this pointer is set to an NSError instance. May be NULL.
+ * \return An NSDictionary with NSStrings corresponding to schema names as keys and NSDictionarys as objects. 
+ *         Each of them will have NSStrings corresponding to relation names as keys and BXEntityDescriptions
+ *         as objects.
+ */
 - (NSDictionary *) entitiesBySchemaAndName: (id <BXInterface>) interface reload: (BOOL) shouldReload error: (NSError **) outError
 {
 	id retval = nil;
 	}
 	return retval;
 }
+@end
+
+
+
+@implementation BXDatabaseObjectModel (PrivateMethods)
+- (id) initWithStorage: (BXDatabaseObjectModelStorage *) storage key: (NSURL *) key
+{
+	if ((self = [super init]))
+	{
+		mStorage = [storage retain];
+		mStorageKey = [key retain];
+		mEntitiesBySchemaAndName = [[NSMutableDictionary alloc] init];
+		mCanCreateEntities = YES;
+	}
+	return self;
+}
+
 
 - (BOOL) contextConnectedUsingDatabaseInterface: (id <BXInterface>) interface error: (NSError **) outError
 {
 	return retval;
 }
 
+
 - (void) setCanCreateEntityDescriptions: (BOOL) aBool
 {
 	@synchronized (mEntitiesBySchemaAndName)

Sources/BXDatabaseObjectModelPrivate.h

+//
+// BXDatabaseObjectModelPrivate.h
+// BaseTen
+//
+// Copyright (C) 2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://basetenframework.org/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <BaseTen/BXDatabaseObjectModel.h>
+
+
+@interface BXDatabaseObjectModel (PrivateMethods)
+- (id) initWithStorage: (BXDatabaseObjectModelStorage *) storage key: (NSURL *) key;
+- (BOOL) contextConnectedUsingDatabaseInterface: (id <BXInterface>) interface error: (NSError **) outError;
+- (void) setCanCreateEntityDescriptions: (BOOL) aBool;
+@end

Sources/BXDatabaseObjectModelStorage.h

 // BXDatabaseObjectModelStorage.h
 // BaseTen
 //
-// Copyright (C) 2009 Marko Karppinen & Co. LLC.
+// Copyright (C) 2009-2010 Marko Karppinen & Co. LLC.
 //
 // Before using this software, please review the available licensing options
 // by visiting http://basetenframework.org/licensing/ or by contacting
 
 @class BXDatabaseObjectModel;
 
+
 @interface BXDatabaseObjectModelStorage : NSObject 
 {
 	id mModelsByURI;
 }
 + (id) defaultStorage;
 - (BXDatabaseObjectModel *) objectModelForURI: (NSURL *) databaseURI;
-- (void) objectModelWillDeallocate: (NSURL *) key;
 @end

Sources/BXDatabaseObjectModelStorage.m

 
 #import "BXDatabaseObjectModelStorage.h"
 #import "BXDatabaseObjectModel.h"
+#import "BXDatabaseObjectModelPrivate.h"
 #import "PGTSCollections.h"
 
 
+
+/** 
+ * \brief The database object model storage.
+ * 
+ * A database object model storage associates a common database object model with each database URI.
+ *
+ * \note This class is thread-safe.
+ * \ingroup baseten
+ */
 @implementation BXDatabaseObjectModelStorage
 __strong static volatile id gSharedInstance = nil;
 
 	}
 }
 
+
+/** 
+ * \brief The default storage.
+ */
 + (id) defaultStorage
 {
 	// No synchronization needed because this gets called from +initialize.
 	return gSharedInstance;
 }
 
+
 - (id) init
 {
 	if ((self = [super init]))
 	return self;
 }
 
+
 - (void) dealloc
 {
 	[mModelsByURI release];
 	[super dealloc];
 }
 
+
+/** 
+ * \brief The object model for a given database URI.
+ * \param databaseURI The database URI.
+ * \return The common BXDatabaseObjectModel.
+ */
 - (BXDatabaseObjectModel *) objectModelForURI: (NSURL *) databaseURI
 {
 	id retval = nil;
 	}
 	return retval;
 }
+@end
 
+
+
+@implementation BXDatabaseObjectModelStorage (PrivateMethods)
 - (void) objectModelWillDeallocate: (NSURL *) key
 {
 	@synchronized (mModelsByURI)

Sources/BXDatabaseObjectModelStoragePrivate.h

+//
+// BXDatabaseObjectModelStoragePrivate.h
+// BaseTen
+//
+// Copyright (C) 2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://basetenframework.org/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <BaseTen/BXDatabaseObjectModelStorage.h>
+
+
+@interface BXDatabaseObjectModelStorage (PrivateMethods)
+- (void) objectModelWillDeallocate: (NSURL *) key;
+@end

Sources/BaseTen.h

 #import <BaseTen/BXConstants.h>
 #import <BaseTen/BXDatabaseContext.h>
 #import <BaseTen/BXDatabaseContextDelegateProtocol.h>
+#import <BaseTen/BXDatabaseObjectModel.h>
+#import <BaseTen/BXDatabaseObjectModelStorage.h>
 #import <BaseTen/BXDatabaseObject.h>
 #import <BaseTen/BXDatabaseObjectID.h>
 #import <BaseTen/BXEntityDescription.h>