1

We are using ORM with bunch of database models and those ORM database queries (and models, of course) - are literally all over application from top to bottom.

And when change in model structure happens it wreaks havoc. Changes are expensive, difficult and stressful.

My suggestion is to surround database schema with nice, clear and consistent API.

It won't solve all of model change related problems, but it will contain most of them.

Furthermore, I think that it makes code more readable as well.

They won't even hear about it. I did tried to approach it very carefully with quotations, examples, still no avail.

Now, I'm starting to doubt my self. Maybe we should have database queries in every single part of application.

What do you think?

vbilopav
  • 11
  • 1
  • The database layer is just an implication of the actual problem: aligning your interests with those of your other team members. workplace.stackexchange.com may be a more suitable place to address this issue. – Frank Jun 21 '16 at 13:47
  • Ok, so, is database layer good idea or not? I'm not eve sure any more... – vbilopav Jun 21 '16 at 13:59
  • I don't think that is issue of aligning our interests. We all share same interest - make great software. What it differs our vision how to achieve it. – vbilopav Jun 21 '16 at 14:18
  • Yes, but we're not http://ConvinceMyCoworkers.com. – Robert Harvey Jun 21 '16 at 14:29
  • So, it is good idea after all and I should try to convince them? Or.... – vbilopav Jun 21 '16 at 14:30
  • You haven't stated your case adequately here, so I don't know how we could even form an opinion. My guess is your approach was similar with your coworkers. You don't make a compelling case. The way you work through a bad architecture is by getting together and discussing ways to improve it, not by saying "this is my solution; please use it." – Robert Harvey Jun 21 '16 at 14:31
  • @vbilopav I think you are right, from what I can read, that separating your sql queries could be a good way to start cleaning up the code if you concider it being hard to maintain. I take a shot in the dark here, are you new to the team maybe? it's usually hard to get your voice heard from the beginning. If you been there a while, I wonder why you haven't already started doing so for your code? – superhero Jun 22 '16 at 11:48
  • @ErikLandvall yes, infact I am :) That's why I was so careful with the team. But they just don't seem to listen to reason and evidence. So much so I was started wondering myself is that good place to start at all. Thanks for the answer. – vbilopav Jun 24 '16 at 07:14
  • @vbilopav we had a discussion about something similar before, I wrote an answer in opposition to the general opinion that I think can be something for you as well: http://programmers.stackexchange.com/a/314897/80409 My suggestion is that you value your time and make sure you are in a company where you can evolve. – superhero Jun 25 '16 at 13:44

0 Answers0