zoukankan      html  css  js  c++  java
  • 编码原则 之 Persistence Ignorance

    原文

    The principle of Persistence Ignorance (PI) holds that classes modeling the business domain in a software application should not be impacted by how they might be persisted.

    Thus, their design should reflect as closely as possible the ideal design needed to solve the business problem at hand, and should not be tainted by concerns related to how the objects’ state is saved and later retrieved.

    Some common violations of Persistence Ignorance include

    • domain objects that must inherit from a particular base class,
    • or which must expose certain properties.
    • Sometimes, the persistence knowledge takes the form of attributes that must be applied to the class,
    • or support for only certain types of collections
    • or property visibility levels.

    There are degrees of persistence ignorance, with the highest degree being described as Plain Old CLR Objects (POCOs) in .NET, and Plain Old Java Objects (POJOs) in the Java world.

  • 相关阅读:
    LeetCode之移除元素
    有被开心到hh(日常)
    交换排序
    插入排序
    顺序查找&折半查找
    C++之引用
    MySQL学习笔记
    C/C++程序编译过程
    计算机面试知识整合(更新中...)
    MFC之编辑框
  • 原文地址:https://www.cnblogs.com/panpanwelcome/p/10195216.html
Copyright © 2011-2022 走看看