Location: PHPKode > scripts > ecSQL > ecsql/description.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="/inc/css/main.css">
<style type="text/css">
<!--
.hdr{text-align:right;font-weight:600;font-size:13px;background:#a3a3a3;}
// -->
</style>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<title>bartholf.nu</title>
</head>
<body>
<table border=0 cellpadding=2 cellspacing=1 width=800>
	<tr valign=top bgcolor="#f3f3f3">
		<td class="hdr">
			Name:</td>
		<td width="100%">
			ecSQL</td>
	</tr><tr bgcolor="#f3f3f3">
		<td class="hdr">
			Version:</td>
		<td width="100%">
			1.0</td>
	</tr><tr bgcolor="#f3f3f3">
		<td class="hdr">
			License:</td>
		<td width="100%">
			Freeware (GPL)</td>
	</tr><tr bgcolor="#f3f3f3">
		<td class="hdr" nowrap>
			Release Date:</td>
		<td width="100%">
			2001-08-30</td>
	</tr><tr bgcolor="#f3f3f3">
		<td class="hdr">
			Comments:</td>
		<td width="100%">
			First release. More work is to be done.</td>
	</tr>
<!--
</table>

<table border=0 cellpadding=2 cellspacing=1 width=800>
-->
	<tr valign=top bgcolor="#f3f3f3">
		<td class="hdr">
			<span style="font-weight:600;">Description:</span></td>
		<td>
			ecSQL is an Object Oriented framework that helps design a database driven web solution.<br>
			Suppose you have a site with a database that, with others, holds information about your customers.<br><br>
			In this case you create a class called Customer and a table called "CUSTOMERS" in order for the code
			to work.<br><br>
			The class consist of two layers, the Data (system.php) layer and the Entity (types.php) layer.<br>
			Theese are separated into two physical files.<br><br>
			
			All data is stored in "Colls" (short for collection which also can be found in Visual Basic, theese works
			exactly the same as the original).<br>
			A collection is an array that holds associative arrays. In the case of a customer it would look something 
			like this:<br><br>
			<code>
			cColl[0]["CUSTOMER_ID"]<br>
			cColl[0]["CUSTOMER_NAME"]<br>
			cColl[0]["TELEPHONE"]<br>
			cColl[0]["FAX"]<br>
			cColl[1]["CUSTOMER_ID"]<br>
			cColl[1]["CUSTOMER_NAME"]<br>
			cColl[1]["TELEPHONE"]<br>
			cColl[1]["FAX"]<br>
			cColl[2]["CUSTOMER_ID"]<br>
			cColl[2]["CUSTOMER_NAME"]<br>
			cColl[2]["TELEPHONE"]<br>
			cColl[2]["FAX"]<br>
			</code>
			<br>
			... and so on ...
			<br>
			Ofcourse the class knows how to automatically create the Colls so no need to worry about that.<br>
			<br>
			<b>What's The beauty in all this then?</b><br>
			Well.. Suppose each index in cColl knows how to create, modify or even remove itself wouldn't that be great??<br>
			That is exactly how this works! Each type inherites the generic ->store(), ->remove() and ->create() methods that
			will make our lives so much easier.
			<br><br>
			
			<u>system.php</u><br>
			This holds all intelligence required to prepare itself with an array of a type that is collected with any one
			of the unlimited fetching functions, one example is "prepareAllCustomers()".<br>
			Each prepare method "prepares" the class with a Coll that consists of many Types or, in some cases, only one.
			This Coll is the easily fetched with the ->getColl() method.<br><br>
			
			Add one class in system.php for each type in types.php. Our Customer would be called "SysCustomer" here. Then
			have a look at the source code to get the idea of how to get things up, it shouldn't be too hard.
			
			<br><br>
			<u>types.php</u><br>
			Manages every type that is to be used. Most functions are generic. Look in the sourcecode for information about
			how to add new types.<br><br>
			
			<span style="font-size:13;font-weight:600;color:red;">Important note!</span><br>
			A database connection class is not implemented yet. Therefore an open connection to your database must be present
			to get this up and running.</td>
	</tr>
</table>
</body>
</html>
Return current item: ecSQL