【发布时间】:2010-10-30 22:42:12
【问题描述】:
全部,
我正在使用 Zend Framework 开发一个应用程序来管理建筑工程的投标。
招标将是一组相当复杂的模型,其架构类似于下面的代码 sn-p。
我的问题是......我应该将投标的总价值存储为投标模型的一部分,还是应该在每次需要时计算它?投标的总价值将是所有组成部分的总和(例如工厂/劳动力/材料/间接费用/等)。
object(Application_Model_Tender)#75 (4) {
["_id":protected] => int(1)
["_name":protected] => string(33) "Tender Name"
["_due":protected] => string(10) "2010-12-01"
["_labour":protected] => array(2) {
[0] => object(Application_Model_Gang)#81 (3) {
["_id":protected] => int(1)
["_name":protected] => string(25) "First Gang Name"
["_gangMembers":protected] => array(2) {
[0] => object(Application_Model_GangMember)#93 (5) {
["_id":protected] => NULL
["_name":protected] => string(11) "Labour Type"
["_workingPattern":protected] => string(7) "Default"
["_cost":protected] => float(546)
["_qty":protected] => int(3)
}
[1] => object(Application_Model_GangMember)#91 (5) {
["_id":protected] => NULL
["_name":protected] => string(11) "Labour Type"
["_workingPattern":protected] => string(8) "Custom 1"
["_cost":protected] => float(777)
["_qty":protected] => int(1)
}
}
}
[1] => object(Application_Model_Gang)#90 (3) {
["_id":protected] => int(2)
["_name":protected] => string(15) "Second Gang Name"
["_gangMembers":protected] => array(1) {
[0] => object(Application_Model_GangMember)#92 (5) {
["_id":protected] => NULL
["_name":protected] => string(11) "Labour Type"
["_workingPattern":protected] => string(8) "Custom 1"
["_cost":protected] => float(777)
["_qty":protected] => int(2)
}
}
}
}
}
【问题讨论】:
标签: oop zend-framework frameworks data-modeling