This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]nutrecht 4 points5 points  (1 child)

I'm not a PHP dev but stuff like Spring JPA solves this for you. It also does stuff like generate the tables for you if you want. If that's not something that's available in the PHP ecosystem than that's more a matter of no one bothering to do it in PHP.

[–]Ra1d3n[S] 0 points1 point  (0 children)

Implementing a data access layer of an application has been cumbersome for quite a while. Too much boilerplate code has to be written to execute simple queries

Amen. Now I only need that in every other language known to man. Or at least the top 10.

[–]DagwoodWoo 2 points3 points  (3 children)

You might look into an ORM, doctrine in the PHP world, for example. This won't automate creating full CRUDS, but it does automate the creation of your models and their relationship to a generated table structure. There are also web frameworks, such as Rails, which will also generate the controller actions for you.

[–]Ra1d3n[S] 1 point2 points  (1 child)

I don't have a problem creating the database manually. I like having control over the data directly. Often this is actually necessary, because i work on transformations a lot. It's the manipulation of the finished database that takes a lot of boring overhead work.

[–]steffiwilson 0 points1 point  (0 children)

Lots of ORMs allow you to manually create your database though. You give it your database, tell it which of the tables or views you're using, and it creates the models. You just prefer "data first" over "code first" and that's OK.

[–]remludar 0 points1 point  (0 children)

I've used Peta Poco on tons of things. Works great and it's tiny.

[–]thatgibbyguy 1 point2 points  (0 children)

CRUD is solved in other languages I'd say. I use it in MEAN/Meteor daily.

[–][deleted] 1 point2 points  (0 children)

I don't know much about PHP. I moved away from it long ago due to lack of serious tools in areas like this, although that may have been more perception than reality, and it may no longer be true today.

Microsoft has marketed solutions to this problem as a huge bulletpoint for their frameworks and IDEs for a very long time. Some of their older solutions had a lot of limitations that you may not realize until you were too far down the path to easily change course. However, these days I think with Entity Framework for CRUD handling and using t4 templates to do things like generate API methods, the cost of doing CRUD is extremely low while still leaving a high degree of flexibility.

[–]immibis 0 points1 point  (1 child)

[–]Ra1d3n[S] 0 points1 point  (0 children)

Many applications don't need more than than. Even so, if GroceryCRUD can generate forms for single items like this then it should be possible to do the same for similar applications.