Code generators vs. ORMs vs. Stored Procedures

前端 未结 6 1971
猫巷女王i
猫巷女王i 2020-12-25 15:21

In what domains do each of these software architectures shine or fail?

Which key requirements would prompt you to choose one over the other?

Please assume th

6条回答
  •  悲&欢浪女
    2020-12-25 16:20

    Stored Procedures

    • Pros: Encapsulates data access code and is application-independent
    • Cons: Can be RDBMS-specific and increase development time

    ORM

    At least some ORMs allow mapping to stored procedures

    • Pros: Abstracts data access code and allows entity objects to be written in domain-specific way
    • Cons: Possible performance overhead and limited mapping capability

    Code generation

    • Pros: Can be used to generate stored-proc based code or an ORM or a mix of both
    • Cons: Code generator layer may have to be maintained in addition to understanding generated code

提交回复
热议问题