Timeline for Application service layer calling database functions. Bad architecture?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 8, 2016 at 16:09 | vote | accept | linuxunil | ||
Dec 8, 2016 at 8:00 | comment | added | Vladislav Rastrusny | @linuxunil SRP should be respected on all levels of architecture. In my case I meant SRP at the level of the service, not at the method level. @ JimmyJames Yep. Most of the ORMs do not work well with the stored procedures. But sometimes stored proces are necessary. | |
Dec 7, 2016 at 16:06 | comment | added | linuxunil | +1 for that line I think in our world everything happens ;) | |
Dec 7, 2016 at 16:04 | comment | added | linuxunil | nice and concise answer. SRP was the first thing that came to my mind when i first looked at the code. Some co-workers say that the method does not violate SRP due to the fact that it only call the database function. But some of those functions do selects, inserts and updates. So it does or not violate SRP? (maybe this itself is another question to discuss separatedly?) | |
Dec 7, 2016 at 15:16 | comment | added | JimmyJames | If I understand correctly, there may be a technical issue in that if updates are happening in functions/stored-procs and also through a ORM, the states of a given transaction is very difficult to reason about. While the application might work in it's current state, a small change could cascade into some really big problems. My experience with Hibernate is that if you don't let it manage the entire set of tables it works with, you will have a lot of annoying issues. | |
Dec 7, 2016 at 14:34 | history | answered | Vladislav Rastrusny | CC BY-SA 3.0 |