Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM v1.8.2

[eluser]Maglok[/eluser]
Just grabbed the fix and checked it out. It seems to be working. Smile Sweet.

[eluser]WanWizard[/eluser]
[quote author="Maglok" date="1362737932"]Just grabbed the fix and checked it out. It seems to be working. Smile Sweet.[/quote]
Cool. Problem solved.

[eluser]Markc[/eluser]
I read almost everything on the official page (http://datamapper.wanwizard.eu/) and I'm confused whether to use this library or to roll up my sleeves and start writing a lot of code which will be the first for me to use Many-to-Many relations in a web site.

The main table is Product table. I have 5 many to many relations (Categories, Materials, Colors, Tags, Cities). There are 5 tables for each of them with these columns (ID, and name of category/tag/city...) and of course there are tables between that has both IDs of the Product and the other table.

Here is how one row should look like.

| ID | Name | Description | Category 1, Category 2, ... | Material 1, ... | Tag1, Tag2, Tag3, Tag4, ... |

I hope you understood me. I know how to do this, and I did this with GROUP_CONCAT() as they assisted me on Stackoverlow.

But what scares me is the Add, Update and Delete function and all the things I have to take care... there will be a lot of queries.

I saw the example code on the official web page of DataMapper, and it looked really easy to use. What bothers me is why there isn't any official update in the past one and a half year? Are there still bugs in it, or for the most common cases it works as it should? Are you still using it in your projects? Is it enough optimized? Would you recommend it, or it's better to write my code from scratch?

[eluser]Maglok[/eluser]
We have a 5 man webdeveloper team here and we used datamapper in our recent projects. The amount of coding required to do the same thing yourself is ridiculous. There are a few alternatives (google 'codeigniter orm'), but in my experience Datamapper is quite nice.

The amount of queries scared me at first, but then I really checked the profiler and it is quite smart actually. A lot of those you might be tempted to do in PHP, while a database is much better suited. It is true though that a ORM does sort of slow down your system some, but that is a choice you'll have to make.

In my experience datamapper takes care of a lot, and thus I have to take care of less things then more.

You can just do:
Code:
$product->save_categories($category)
To create a relation between product and category. As long as you have your model and database setup.

[eluser]Markc[/eluser]
[quote author="Maglok" date="1362987868"]We have a 5 man webdeveloper team here and we used datamapper in our recent projects. The amount of coding required to do the same thing yourself is ridiculous. There are a few alternatives (google 'codeigniter orm'), but in my experience Datamapper is quite nice.

The amount of queries scared me at first, but then I really checked the profiler and it is quite smart actually. A lot of those you might be tempted to do in PHP, while a database is much better suited. It is true though that a ORM does sort of slow down your system some, but that is a choice you'll have to make.

In my experience datamapper takes care of a lot, and thus I have to take care of less things then more.

You can just do:
Code:
$product->save_categories($category)
To create a relation between product and category. As long as you have your model and database setup.[/quote]

Where can I download the latest version of DataMapper?

[eluser]Maglok[/eluser]
That'd be bitbucket for the 1.8.2 https://bitbucket.org/wanwizard/datamapper
The new in development 2.* is on github.

[eluser]WanWizard[/eluser]
[quote author="Maglok" date="1363073750"]That'd be bitbucket for the 1.8.2 https://bitbucket.org/wanwizard/datamapper
The new in development 2.* is on github.[/quote]

Download 'tip' to get the latest version, there have been several fixes since 1.8.2 was released.

And ignore '2.*'. Chances of that ever materializing are very slim atm. I haven't written any CI code in over two years now, and that is not going to change. So for me there is no incentive to spend time on it.

A new ORM will arrive within a few months, which is already in use in another framework (which I will not mention here), and will be framework independent. If will bring it's own DBAL, and it will work completely different from what you're used to with DM, but I'm pretty sure it's going to work with CI.

For the moment, and as long as I can find the time, I will continue to support the current Datamapper release, but don't expect any major changes from me. Having said that, Datamapper has been around for over 5 years now, is quite feature rich, and very stable. Given the fact that CI hardly ever changes, there is no reason why you shouldn't use it.

[eluser]matyhaty[/eluser]
Wan, come on still the beans......
Does it come with amazing DB cache options?

[eluser]WanWizard[/eluser]
No.

Caching in my opinion should not be an ORM feature, you should deal with that in your controller.

If your ORM caches, it can only cache based on the generated query, and use (for example) a hash of that as cache key. This means that since it has a random key, you can not access, update or delete the cached item from the outside.

Given the fact that you would want your CRUD functions to delete the cache (you have updated a record), you need the cache key to be known.

If does however do quite a lot of internal caching. It will for example never fetch and hydrate the same record twice, it will cache query results.

It comes with tonnes of other features though, including built-in soft-delete en temporal support (versioning).

[eluser]matyhaty[/eluser]
Is there a beta
About to rewrite a whole chunk of code and this might be a nice way forward

I've extended DM quite a bit for caching, however more focused and view caching now - esp if multi requests of same query are internally caching (which was something on my to do list for DM)

Ta




Theme © iAndrew 2016 - Forum software by © MyBB