Welcome Guest, Not a member yet? Register   Sign In
Is This CRUD or ORM?
#1

[eluser]MatthewSchenker[/eluser]
Greetings CI Community,
I've been developing some sites using CodeIgniter and have been making good progress moving my Web-development over to this platform. But there is one thing I need to clarify better, and that is what process, library, and methods are needed to accomplish a set of constant tasks.

I've Googled this for many hours, and bookmarked loads of CRUD and ORM places in an effort to pin it down. All that effort is teaching me a lot, but it's also making me want to make sure I'm heading down the right path.

Others must be wondering the same thing. Maybe we can summarize the issues and answer it here?

SUMMARY OF WHAT IS NEEDED
1. Create entry forms that gather data on the "front end" of my site.
2. Write data from those forms into my pre-defined and pre-configured CI database.
3. Create pages from the data in the database.
4. Allow users with certain rights to edit the pages created from that data.
5. When someone edits a page, show the entry form again, populated with data previously entered in the creation step.
6. Allow user's with certain rights to delete pages.

LIBRARIES OR HELPERS I PLAN TO USE
For the authorization/authentication actions to control who can see specific pages and forms: I really like Ion Auth.

For the entry/edit functions, I'm looking at either using the built-in CodeIgniter Form Helper or the Form Generation Library.

RESOURCES I'VE CONSULTED
I've looked at some great resources on CRUD and ORM:
Simple CRUD with CodeIgniter
Grocery CRUD

And several others!

I'm not looking (at the moment) for styling and JQuery details. Just the basic functions. I'm also not necessarily needing data tables at the moment.

QUESTIONS
Given all this, am I thinking the right way regarding libraries and resources?

Am I describing something that can be done properly with a form helper or form library and simple CRUD coding, or am I missing something?

Are there other resources I should consult on best practices?

Is there an ORM I should be putting into the mix? If so, why?

Thank you for your input!

Matthew
#2

[eluser]WanWizard[/eluser]
It's a bit of an odd question, because CRUD is an accronym describing a process, while ORM describes a data mapping architectural pattern.

CRUD is about forms and data entry.

An ORM allows you to abstract a lot of data manipulation code away in ORM models, keeping your controllers clean and easy to maintain. An ORM is also away of the relations the models have with other models, and can use those relations when interacting with the data. You can tell an ORM to update something based on values in different models, and the ORM will translate that into the SQL needed to perform that action. Changes to the model doesn't mean you have to go through all your controller code to check and possible update handwritten SQL.

#3

[eluser]MatthewSchenker[/eluser]
Hello WanWizard,
Thanks for your input!

I've made the assumption that I'm talking about CRUD. Then I was doing some reading on Stack Overflow and saw a comment from a developer that "people sometimes say CRUD when what they really mean is ORM." That got me wondering if I'm missing something.

Perhaps a better way to ask the question is like this...

Am I able to accomplish my goals properly with the following combination:
-> Simple CRUD with CodeIgniter
-> CodeIgniter's Form Helper or the Form Generation Library
-> Ion Auth

Or is there something else I should be looking at for best practices?

Thanks,
Matthew
#4

[eluser]Aken[/eluser]
Just to clear things up...

CRUD = Create Read Update Delete. Basically the overall process of creating and manipulating data in a broad term.

ORM = Object Relational Mapping (map, mapper, manager, what have you). In CodeIgniter case, it typically means database interaction.

You would use an ORM to assist you in doing CRUD actions.
#5

[eluser]MatthewSchenker[/eluser]
Hi Aken,
Thanks for helping. I know what CRUD and ORM mean. Sorry if I made it seem as though I was asking something like that.

What I'm trying to figure out if CRUD actions can be handled entirely with the form helper, an auth library, and some good tutorials on CRUD. Or am I missing something in that mix?

This might very well be a case of me gathering too much information and making something more complicated than it needs to be!

Thanks,
Matthew




Theme © iAndrew 2016 - Forum software by © MyBB