(Base One logo) .NET database and distributed computing tools

BFC | Visual Studio | Database Technology | Distributed Computing | Scroll Cache

BFC Database Classes and Components

The BFC Database Library is built from scratch (on MFC's CObject) to implement Base One's unique architecture for large-scale, high security transaction processing systems, such as needed for both client/server and 3-tier Internet applications. By cleanly separating the database subsystem from other components, BFC achieves a great degree of modular independence.

Using just the Database and Utility C++ libraries (or COM or .NET components), an existing application can be retrofitted. BFC improves database handling behind the scene, while the modified system continues to look and feel the same to end users. This makes it possible, for example, to build a large-scale batch processing (distributed computing) application that requires no user interaction using only the Database and Utility libraries. Modularity is the guiding principle, because it makes the design more understandable, and this ultimately makes applications more reliable and maintainable.

BFC Database Classes Hierarchy Chart (MFC)

BFC Database Classes Hierarchy Chart

The Database Manager Class (clsDbMgr) provides the main functions for operating on databases as a whole, as well as a variety of other useful functions. For example, the Open Database Function (OpenDb) of clsDbMgr prepares a specific database for use and must be called before data can be stored to or retrieved from that database. If the database is across the Internet, the function SetInetServ() must be called before OpenDb(). clsDbMgr also provides functions for switching between databases, committing, and rolling back.

BFC supports the concept of a current database. If you have multiple databases open, you still have only one current database, and all actions take place against the current database. You can switch between databases, and doing a successful OpenDb causes the specified database to become the current database no matter how many other databases are also open.

There are several kinds of database buffers: a record database buffer, three kinds of sets, a key buffer, and a buffer for stored procedures. (A set is one or more records or rows of data.) Database buffer classes represent areas of the client workstations's main memory used to receive and transmit data from the database. A record database buffer class can contain only one record at a time, whereas a set database buffer class can contain more than one record.

  • clsRecBase (Record Base class) - has functions for adding, changing, deleting, and finding records.
  • clsRecSetBase (Record Set Base class) - allows you to do arbitrary SQL
  • clsRecSetScrlCache (Scroll Cache Record Set class) - similar to clsRecSetBase except that performance for scrolling through large numbers of records is optimized. You can only use sort orders for which you have indexes. (You use SetSortKey() to set the sort order and indicate which index should be used.) Holds on to database locks for the shortest possible time.
  • clsRecSetFil (Record Set File class) - for storing and retrieving a result set in a Record Set FILE.
  • clsRecSetMod (Modification Record Set class) - for doing "bulk" modification operations, such as bulk insert.
  • clsProcBase (Procedure Base class) - for running database stored procedures.

In general, the Record and Scroll Cache Record Set classes (clsRecBase and clsRecSetScrlCache) are the database classes that are used most often. The Record Set Base class is for SQL that is too complex to do through record or scroll cache buffers or for retrieval from legacy databases that do not include the Rich Client Data Dictionary. The Record Set File class is especially useful as a vehicle for information sharing and exchange and offers a secure, large-scale, method for leveraging file storage outside the database itself.

The Record Set Base class (clsRecSetBase) and the Scroll Cache Record Set class (clsRecSetScrlCache or Scroll Cache for short) are used for getting multiple records at a time. Scroll Cache makes extensive use of the Database Index Dictionary.

Both Record Set Base and Scroll Cache classes represent an area of main memory for receiving a set of records or a part or all of a query result. Both classes are read-only database buffers. They support the SQL SELECT operation only, and do not support any database modification operations. clsRecSetScrlCache supports scrolling forwards and backwards. It is efficient for moving back and forth a record at a time and a page at a time, as well as for going to the last record and the first one.

Scroll Cache is significantly more efficient than clsRecSetBase for large, multi-user applications. Scroll Cache releases all locks as soon as its buffer is full, which increases concurrency between multiple users. Scroll cache automatically constructs and executes a new query when additional data (outside of what is in the local cache) is needed to fulfill a scroll request.

Since Scroll Cache always favors an index scan, all browsing operations take approximately the same, short time, even if the result set contains hundreds of thousands or millions of records. This feature is not available in clsRecSetBase and for that matter it is not available in any other class library available today. 

(For more about improved browsing through Scroll Cache, see Dr. GUI is NOT Dr. Database)

The database library includes a Command Processor capable of running complex scripts that include SQL and DOS commands, plus special commands designed for loading and unloading large databases. The Command Processor Class (clsCmdProc) is used to execute Base/1 commands and SQL statements either by function call or from a file.

The Database Field Value class (clsValDbFld) is a helper class which handles character, numeric, date and time values as strings. The Database Field Mask class (clsDbFldMask) is useful for formatting any of these data types.

The Number Database Field class (clsNumDbFld), or "Number Class" for short (U.S. Patent Number 6,384,748), provides a general purpose data type for numbers. It has the ability to hold very large or small numbers and do high precision arithmetic on them. Since the Number Class can be used as part of BFC or as a stand-alone class, it is described separately, in the manual titled "Base/1 Number Class".

Finally, the Internet Server class (clsInetServ) is used only by the Base One Internet Server (BIS) itself and provides all the functions needed by the Internet Server Manager and Internet Server Processes. Thin Client applications also use the Internet Server class's COM interface for Database Session control. (Rich Client applications handle Database Session control automatically, such as making sure there is only one Logon per User ID.)

Applications gain access to data across the Internet through the Database Session Manager class (clsDbMgr) and not the Internet Server class. Application programmers only work directly with the Internet Server class and its functions for advanced, server-side use.

Database programming is the same whether the database is local or across the Internet. The same Database Manager, Record, Set and Command Processor classes are used for Internet and client/server programming.

BFC | Visual Studio | Database Technology | Distributed Computing | Scroll Cache

Home Products Consulting Case Studies Order Contents Contact About Us

Copyright 2012, Base One International Corporation