关闭

POJO的解释(最接近出处,目前所见最准确)

633人阅读 评论(0) 收藏 举报
http://c2.com/cgi/wiki?PlainOldJavaObject

Plain Old Java Object

POJO = "Plain Old Java Object". Term coined by MartinFowler, RebeccaParsons?, and JoshMacKenzie to denote a normal Java object that is not a JavaBean, an EntityBean, a SessionBean, etc., and does not serve any other special role or implement any special interfaces of any of the Java frameworks (EJB, JDBC, DAO, JDO, etc...). Any Java object can run within an EJB container, but many people don't know that or forget it. Fowler et al invented the acronym POJO so that such objects would have a "fancy name", thereby convincing people that they were worthy of use. POJOs are useful for creating a DomainModel. In contrast, the various types of beans and other special Java objects often have constraints that make it difficult to use them directly to model a domain.
I see a tendency of people fudging that definition of POJO because their ObjectRelationalMapping products obviously do not support POJO persistence, as they would like to announce. The typical case is referring to the JSR-220 (EJB3, JDO2) as "POJO persistence", when the EJB 3.0 early draft makes it clear that it is only a "Simplification of the enterprise bean types. Enterprise beans are simplified to more closely resemble plain Java objects ("POJOs") or JavaBeans." --KlausWuestefeld
For real POJO persistancy have a look at PersistedObjectTree unlike KlausWuestefeld's Prevayler it lets you use any type of data structure. -- Bjorn Blomqvist

EditText of this page (last edited October 3, 2007)
FindPage by searching (or browse LikePages or take a VisualTour
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:859302次
    • 积分:11524
    • 等级:
    • 排名:第1333名
    • 原创:253篇
    • 转载:166篇
    • 译文:3篇
    • 评论:80条
    最新评论
    my webs