[eluser]Doug Lerner[/eluser]
[quote author="mahuti" date="1215673702"]Since the web is 'stateless' you kinda need some kind of storage mechanism if you're going to be playing with large amounts of data. You could write the data to pages or caches to store & access with a session variable, but I imagine using a database would be faster.[/quote]
Oh, for sure I want to store my objects in a database!
I just want to figure out the best way of doing it without spending all my time writing database methods and manually updating the database to handle new tables and columns, etc.
Just as a for-instance:
In the proprietary system I've been using (which used server-side JavaScript and a proprietary object-oriented database, non-SQL), if I wanted to add a new user property I could just say:
theUser.someProperty = whatever;
This would store the value of whatever in the database in the user record. I didn't have to set up the "someProperty" property in a table anywhere. And the value of whatever could be a scalar, an object, an array, an object containing arrays containing objects - anything.
I am wonder what my approach has to be in CI in order to accomplish something nearly as simple?
If I wanted to add a new property to a user record it seems I first have to do some database twiddling in order to make sure that the user table has an entry for "someProperty".
And if the value of someProperty is anything other than a scalar value, I have to do what? I'm not sure yet. I suppose I could serialize the value and store it that way. Otherwise I have to add more tables to represent the object that is being stored and link it in somehow, right?
What I want to do is move into open source development where there is a larger developer and customer base and better "future proofing". And I want to move in MVC so I can easily separate out my business logic from views.
But I also want the ease of being able to work with possibly complex objects and just store and reference them and retrieve them at will without spending a lot of time having to fiddle with the internals of the database every time I want to add a new property to an object or add new objects, etc. In other words, I want to think about my application higher-level logic, and not spend my time thinking about the low-level details of how the data is stored internally.
That is the part I'm stuck on.
I'm an experienced developer - but unfortunately not experienced with SQL or PHP frameworks. I've been in my little developer cave using this special proprietary development system for a few select customers for 8 years and now want to work more in the "real world". But I'm finding going from straightforward object-oriented development, including the storage of object-oriented data, to the existing frameworks a learning curve. It seems that "ORM" is the way frameworks deal with the particular issue I'm talking about, right?
Thanks!
doug