- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在计划为应用程序组件实现继承映射器模式
http://martinfowler.com/eaaCatalog/inheritanceMappers.html
它需要具有的一个功能是让域对象引用大量聚合项目(10,000 个其他域对象)
所以我需要某种延迟加载集合从聚合根域对象传递到其他域对象。
为了保持我的(php)模型脚本有条理,我将它们存储在两个文件夹中:
MyComponent\
controllers\
models\
domain\ <- domain objects, DDD repository, DDD factory
daccess\ <- PoEAA data mappers, SQL queries etc
views\
最佳答案
简单的答案是它可能位于您的数据访问层中。
//Domain Object
class Store {
public function GetGiantListOfProducts() { }
}
//DataAccess Object
class LazyLoadingStore extends Store {
public function GetGiantListOfProducts() { // function override
// data access code
}
}
class StoreProvider {
public function GetStoreById($id) {
//User expects a list of Store, but you actually return a list of LazyLoadingStore - nobody need know the difference
}
}
class ProductProvider {
public function GetAllForStore($store) {
// return list of products for the store
}
}
关于php - OOP 应用架构 : Which layer does a lazy loader sit in?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2563473/
在我的博客应用中,用户可以输入任何文本作为他们条目的标题,然后我会根据文本生成一个 URL。 我验证他们的标题以确保它只包含字母和数字。 如果他们输入类似的内容 Lorem 3 ipsum dolor
有人知道这方面的信息吗? 最佳答案 如果您愿意,您可以签署自己的 SSL 证书。你可以去here有关在 Linux 下设置自签名证书的一些建议,或者您可以转到 here获取针对基于 IIS 6 的环境
我在 JFrame 上绘制了三个 JPanel。这些目前都设置为使用默认的 FlowLayout。我希望这些在单个列中一个一个地放在另一个之上。 但是,我发现它们在同一条线上彼此相邻 float ,只
我正在计划为应用程序组件实现继承映射器模式 http://martinfowler.com/eaaCatalog/inheritanceMappers.html 它需要具有的一个功能是让域对象引用大量
我想在开发环境中的应用程序中添加临时 JavaScript 代码,但是当我们要进行生产构建时,该代码将被忽略,并且不会包含在新构建的代码中。 var userLoggedIn = isUserLogg
我一直在 Java 1.5 上开发 SpringSource 3.2 项目。这个项目的目的是在解析excel中的数据后,获取一个excel文件并输出到我们自己格式的另一个文件中。 当在我的本地开发环境
我的边栏看起来非常舒服,位于我的内容下方,即页面的左侧。我怎样才能说服它留在它身边?它应该位于页面的右侧,内容位于左侧。我一直在尝试以前对类似问题的回答,但没有任何改变我得到的结果。 This is
我有一个具有固定背景的网站和另一个位于我已成功定位的页面中心的小图像,但是当我尝试将另一个 div 放入应该包含文本的位置时,问题就来了和内容,它位于图像下方。 您可以在此处查看我的示例:(请不要担心
我无法检索子表记录相关审计的 auditable_type,因为它总是给出父表类名。 我有: class Patient < ActiveRecord::Base has_many :disease
我好久没有遇到这么令人费解的问题了。我有一个类引用另一个位于同一应用程序的另一个包中的类,也就是说,不在另一个 jar 存档文件中。 包含类是learnintouch-rest/src/test/ja
我正在使用 UIImagePickerController cameraOverlayView 属性创建自定义相机 UI。但是,我想保留一些现有的用户界面——特别是顶部的闪光灯和相机选择按钮。 我的想
我目前正在使用 Twitter Bootstrap 开发网站。在网站的设计中,我有一个背景图像,它位于容器边缘和主体边缘之间。 下面是我的代码。 HTML:
背景: 我正在开发一个 iPad 应用程序,当用户单击图像时,它会弹出一个自定义 View 。我希望 View 具有圆角和位于右上边缘的关闭按钮(圆圈中的红色 x)。 按钮一半在 View 内,一半在
我的问题是我的非移动布局。我有四列。这是它们的顺序(宽度适用于 sm/md/lg): A(3-wide) B(9-wide) C(9-wide) D(3-wide) B 列是一个很大的可变高度列。所以
我是一名优秀的程序员,十分优秀!