1

Topic: Design of a layer of data access

As it is known, there are two methods to generate the interface of change of object in DAO: a) create/update where the first returns an error at attempt to save existing object, and the second - at attempt to update the new. b) save which is able both to create and to update objects you for what variant and why?

2

Re: Design of a layer of data access

Hello, scf, you wrote: scf> you for what variant and why? I for DDD. At each variant the semantics which can be preferable to different data domains and scenarios.

3

Re: Design of a layer of data access

Hello, scf, you wrote: scf> As it is known, there are two methods to generate the interface of change of object in DAO: scf> a) create/update where the first returns an error at attempt to save existing object, and the second - at attempt to update the new. scf> b) save which is able both to create and to update objects For). On REST it is well displayed.

4

Re: Design of a layer of data access

Hello, Sharov, you wrote: S> Hello, scf, you wrote: scf>> As it is known, there are two methods to generate the interface of change of object in DAO: scf>> a) create/update where the first returns an error at attempt to save existing object, and the second - at attempt to update the new. scf>> b) save which is able both to create and to update objects S> For. On REST it is well displayed. And if Save> PUT (but here looking as correspondence is defined)

5

Re: Design of a layer of data access

Hello, scf, you wrote: scf> you for what variant and why? For both depending on specific a Prosiberian salmon

6

Re: Design of a layer of data access

Hello, Doc, you wrote: S>> For. On REST it is well displayed. Doc> and if Save> PUT (but here looking as correspondence is defined) How to understand Save> PUT? Type Save more (can fulfill) than Put?

7

Re: Design of a layer of data access

Hello, Sharov, you wrote: S> How to understand Save> PUT? Type Save more (can fulfill) than Put? Save to display on Put

8

Re: Design of a layer of data access

Hello, Doc, you wrote: Doc> Hello, Sharov, you wrote: S>> How to understand Save> PUT? Type Save more (can fulfill) than Put? Doc> Save to display on Put Well then save breaks srp - both creation and update of objects, all on it.

9

Re: Design of a layer of data access

Hello, Sharov, you wrote: S> Well then save breaks srp - both creation and update of objects, all on it. I.e. on yours PUT basically against srp? IMHO it already depends on a specific target. Since the letter "r" in srp is defined to it.

10

Re: Design of a layer of data access

Hello, Doc, you wrote: Doc> I.e. on yours PUT basically against srp? Save  update (put) and create (post). As  it is not so healthy. But depends on the task and data domain.

11

Re: Design of a layer of data access

Hello, Sharov, you wrote: S> But depends on the task and data domain. Well so and I about what?

12

Re: Design of a layer of data access

Hello, scf, you wrote: scf> As it is known, there are two methods to generate the interface of change of object in DAO: scf> a) create/update where the first returns an error at attempt to save existing object, and the second - at attempt to update the new. scf> b) save which is able both to create and to update objects scf> you for what variant and why? For. It is normally known that becomes in the code -  or  object. And if suddenly what error and  to update object, and it is not present (not that  is received, or is already remote) that  a made error (the object does not exist), in a case the problem gets out strongly later with big kol-vom time spent for search and probably and still a row of unpleasant side displays.