What is the use of a persistence layer in any application?

前端 未结 5 1721
猫巷女王i
猫巷女王i 2020-12-12 22:42

I have to create an application in which I am asked to create an persistence layer in the application. The application is in .net. I have created a business layer and a pres

5条回答
  •  -上瘾入骨i
    2020-12-12 23:03

    Persistence = read/write/delete records to disk or database.

    Layer = insulation, etc.

    Persistence Layer = generally means to isolate read/write/delete logic from the business logic. ideally by placing a few (or a single) point of interaction between the business logic and the persistence modules.

    I think its something we've all done (save to disk, db, etc), this is just a fancy academic term, they're just asking us to:

    1. make sure that the persistence parts group together nicely,
    2. ideally with few (or exactly a single) point of interaction inbetween business logic (ie. gateway pattern),
    3. so in the future maybe we'd like to switch database types or hosts (i.e. smaller scope - we'd just need to muck around the persistence parts to get it running).

    Cheers,

提交回复
热议问题