That's just the data storage model.not a framework
Client / Ajax < - > PHP business tier < - > EAV DB
Moderator: General Moderators
That's just the data storage model.not a framework
Again, lots of applications use Ajax and implement dependencies to have a clear business tier/layer. Most modern MVC frameworks encourage/enforce 3-Tier. Business Tier being the old 3-Tier name -- it is usually called the Model or Domain Layer these days.powerofq wrote:Client / Ajax < - > PHP business tier < - > EAV DB
is this similar to data driven programming? do you know of an OS CMSs that store logic in the data layer that I could check out, or am I totally confused here lolarborint wrote: I have seen a similar DB design in other CMSs,
Code: Select all
<form id=”ordercustomcakeform” action='commander.php'>
<input type=”hidden” name=”order” value=”ordercustomcake”>
<input type=”text” name=”message” />
</form>
<a href=”#” onclick=command(“ordercustomcakeform”);>ORDER</a>
Code: Select all
<?
$order = $_POST['order'];
function e($order){
$code = singlevalue($order, 'order');
Eval($code);
}
e($order);
?>Code: Select all
e('papers');
e('uniquesubject');
e('insertatom');
e('respond');
$uid = papers();
$message = $_POST['message'];
$orderid = uniquesubject();
insertatom($uid, 'hascakeorder', $orderid)
insertatom($orderid, 'message', $message);
respond('Order has been saved');Code: Select all
bob hascakeorder A39G2B...
A39G2B... message "Happy Birthday Neo"Code: Select all
<form id=”viewcakeordersform” action='commander.php'>
<input type=”hidden” name=”order” value=”viewcakeorders”>
</form>
<a href=”#” onclick=command(“viewcakeordersform”);>VIEW ORDER</a>
<div id="cakeorderresults"></div>Code: Select all
e('papers');
e('vofsandp');
e('sorttable');
$uid = papers();
$allorders = vofsandp($uid, 'hascakeorder');
$headings = array('OrderID', 'Message');
$data = array();
foreach($allorders as $order){
$msg = singlevalue($order, 'msg');
array_push($data, $order);
array_push($data, $msg);
}
$output = sorttable($headings, $data);
echo "$('cakeorderresults').innerHTML = '$output';";I do use one global, 'page' which holds the name of the page the ajax request came from, but not necessary.arborint wrote:I assume that there are globals that hold all the magic between function calls...
Code, like everything else, is data.. what makes php data special? But storing the code in a table has other benefits that more than offset any 'overhead'. An order has a unique SUBJECT name like everything else.. Take the singlevalue(); order/function as an example.. we can store metadata with it ie:arborint wrote:overhead of the database access to load the code
Code: Select all
Subject / Predicate / Value
singlevalue / lastaccessedby / bob
singlevalue / lastmodifieddate / 080703
singlevalue / revision1 / "... "The ability to combine data with behavior.powerofq wrote:Code, like everything else, is data.. what makes php data special?
This is starting to sound a lot like ezPublish's content model, which I like very much. It's a slightly more normalized version of your system, where "objects" (your subjects) have their own table, and the "object_properties" table (your values) has a foreign key association with the objects table. This is then organized by classes, so that every object has a foreign key association with a specific class, and then "class properties" for each class (your predicates). See here for a better explanation.powerofq wrote:Storing the code in a table has other benefits that more than offset any 'overhead'. An order has a unique SUBJECT name like everything else.. Take the singlevalue(); order/function as an example.. we can store metadata with it ie:Code: Select all
Subject / Predicate / Value singlevalue / lastaccessedby / bob singlevalue / lastmodifieddate / 080703 singlevalue / revision1 / "... "
You can certainly say sentences like that, but saying so does not mean they are not nonsense. There is a clear distinction between 'code' and 'data' in that code can be executed. But the discussion here does not really get to that discussion. It is really about where the code is stored.powerofq wrote:Code, like everything else, is data.. what makes php data special?
There is really no difference between the information you attribute to a specific request and what is available with Front/Action Controllers.powerofq wrote:But storing the code in a table has other benefits that more than offset any 'overhead'. An order has a unique SUBJECT name like everything else.. Take the singlevalue(); order/function as an example.. we can store metadata with it ie:
I think the latter may have contributed a bit to the former...arborint wrote:powerofq wrote:incomprehensible to the average programmer, and used a bunch of mumbo-jumbo like 'metadata,' 'entity' and 'semantic network model' to describe it...
I've benchmarked in the past, and it scales better than average. Imagine the index on a 3 column table where your query is pulling all cake orders "select value from atoms where subject='bob' and predicate='hascakeorder' ". The same structure in a hash table was blazing. The model works nicely with memcached as well, and has room for further optimizations.jshpro2 wrote:How well does this profile on large data sets, is this scalable? So your whole data layer resides in this one table? ( or duplicate tables of the same structure )?
Absolutely. It's a fairly extensive topic, but it's actually the reason I developed this framework.jshpro2 wrote: How do you decide to partition the data? Do you group together similar predicates, like hascakeorder and hasmuffinorder, are the predicates indexed anywhere so the framework knows those two predicates have similar semantic meaning?
Semantic Networking has more purpose in some areas than others. I don't know there's much use for it in baked goods, for example.. but you could do something like this. "Display all bakery orders shipped on Thursday that weighed less than 1 pound.""What is common to all semantic networks is a declarative graphic representation that can be used either to represent knowledge or to support automated systems for reasoning about knowledge."
http://www.jfsowa.com/pubs/semnet.htm
"Metadata helps to bridge the semantic gap. By telling a computer how data items are related and how these relations can be evaluated automatically, it becomes possible to process even more complex filter and search operations. For example, if a search engine understands that "Van Gogh" was a "Dutch painter", it can answer a search query on "Dutch painters" with a link to a web page about Vincent Van Gogh, although the exact words "Dutch painters" never occur on that page. This approach, called knowledge representation, is of special interest to the semantic web and artificial intelligence."