`
shermenn
  • 浏览: 14469 次
  • 性别: Icon_minigender_1
  • 来自: 珠海
社区版块
存档分类
最新评论

validation 和 logic process method

 
阅读更多
今日遇到一个问题是要在一个原来的 create document flow上加validation,如果validation 失败将会停止 做业务处理 create document 。
create document 有两个方法:single create document , multiple create.

旧的逻辑是 使用java 调用  store procedure singleCreate. 而且这个 store procedure 还在被其他 store procedure multipleCreate调用。
那么 validation 应该加到store procedure singleCreate 还是 java 层次。

1.加在java 层面,
优点是
逻辑易于理解,软件易于维护

缺点是
1.数据库连接量会加大,性能降低。(虽然系统的性能还不是主要问题,但是保持一种性能危机感还是必须的)因为校验的过程同样需要使用sql 验证。


2.修改store procedure  singleCreate 和 multipleCreate
优点是
性能优越,容易修改

缺点是
不易于维护,使得validation 工作同时分散于 java 和 store procedure 两个层面


最后我还是向项目deadline 妥协了  把validation 加在了 store procedure 上面

validation 走在 logic process method 前面才是规范
我在方便的勾引下 走回了过程编程思想,罪过 

分享到:
评论

相关推荐

    c#编程规范和范例

    // Method to handle the login process and validate the credentials. public void HandleLogin() { // Validation logic } ``` #### 三、标识符命名规范 **3.1 英文单词或缩写** - **规范**: 标识符的...

    SAP BW Tables

    - Ensuring data quality through validation checks. #### TextnameofTransferRoutine (RSAROUTT) **Purpose:** This table stores the text description of transfer routines, providing documentation and ...

    外文翻译 stus MVC

    To use Action, subclass and overwrite the process() method. The ActionServlet (Command) passes the parameterized classes to ActionForm using the perform() method. Again, no more dreadful request....

    Effective C#

    - **Benefits:** Using properties instead of public data members enhances encapsulation and allows for validation logic, lazy loading, and caching without changing the API. - **Implementation:** Define...

    Bochs - The cross platform IA-32 (x86) emulator

    - GUI: select mouse capture toggle method in .bochsrc. - Ported most of Qemu's 'virtual VFAT' block driver (except runtime write support, but plus FAT32 suppport) - Added write protect option for ...

    spring-framework-reference4.1.4

    Dependency resolution process ................................................................. 35 Examples of dependency injection ............................................................. 36 ...

    spring-framework-reference-4.1.2

    Dependency resolution process ................................................................. 35 Examples of dependency injection ............................................................. 36 ...

    Software Testing and Continuous Quality Improvement

    32 3 Quality through Continuous Improvement Process . . . . . . . . . . . 41 Contribution of Edward Deming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Role of Statistical ...

Global site tag (gtag.js) - Google Analytics