CodeIgniter Forums
DataMapper 1.6.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: DataMapper 1.6.0 (/showthread.php?tid=11358)



DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]BaRzO[/eluser]
Welcome nice to hear you are back Wink


DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]sankai[/eluser]
stensi,welcome back!!! :cheese:


DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]OverZealous[/eluser]
Welcome Back! :coolgrin:


DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]bEz[/eluser]
Well, after recently joining the CI Community, I've managed to stumble upon DM and have deligently followed this thread from it's creation. I see the development benifits of DM, as well as see various greater extension of DM via numerous request throughout this thread.

stensi, OverZealous.com and others have greatly paced the growth of the (model) "Library" ;-P

btw, welcome back from your trip!


DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]Neovive[/eluser]
Very nice! This is a very interesting approach to ORM. Are there any examples of adding custom methods to a model that extends DataMapper?


DataMapper 1.6.0 - El Forum - 11-18-2008

[eluser]OverZealous[/eluser]
There are a bunch previously listed in this thread. It's extremely easy! They can be as simple as utility functions:
Code:
/**
* Get By Id
*
* Gets an object by id.
*
* @access public
* @param int id of object
* @return $this
*/
function get_by_id($id, $allow_new = TRUE) {
    $this->where('id', intval($id));
    $this->get();
    if(! $allow_new && $this->is_new()) {
        show_error($this->lang->line('error_invalid_id'));
    }
    return $this;
}

Or as complex as entirely new ways of selecting data (see some of the extensions to DM that involve relationships a few pages back.


DataMapper 1.6.0 - El Forum - 11-19-2008

[eluser]Mortred[/eluser]
hi!

thanks for the great work on DM..

anyway, will this support php4?

Smile


DataMapper 1.6.0 - El Forum - 11-20-2008

[eluser]cahva[/eluser]
[quote author="Mortred" date="1227099815"]
anyway, will this support php4?
Smile[/quote]

Who cares :cheese:

Why people still insist PHP4? By now all PHP4 servers should be more or less upgraded to PHP5. Ofcourse there are exceptions on some software/sites but usually to get old PHP4 scripts with old fashioned(=bad) coding to get working on PHP5 is just downgrading some php config values(register_globals, register_long_arrays etc.). If theres no GOOD reason to use PHP4, move the site(or ask your host) to PHP5 server. I work in a hosting company and we usually copy the site to new server so client can first test their site and if theres problems, we'll fix them or tell the customer how to fix them. And those problems are almost always just those god damn register_globals or using long arrays Smile And usually we first try to get customer to fix their code and if they're not willing to or is hard to do, set the PHP config values so its backward compatible.

Sorry for the blurb, just had to comment on that PHP4 because I personally dont see the benefit of running PHP4 anymore.

Ok, now the thing I was first supposed to write about:

Good work on the DM stensi! Specially the documenting is great and many other developers should watch your example. There were many ORM that I was thinking of using but your clear and well written documentation got my attention in the first place. I personally SUCK at documenting anything I do, but I'm trying to improve on that part.

We're starting to build a massive ERP and we've been juggling the decision for couple of weeks if we're going to use DM or not. The fear was that we will have lots of database tables and the way we have to use the normalization. Normalization is generally very good thing to do and I do that, but not go so far with it usually(you CAN over-normalize if you get too exited with normalization and performance can drop dramatically).

To get the project started, we decided to use DM. Hope we did not do a wrong decision and I'm fairly confident that we didnt Wink


DataMapper 1.6.0 - El Forum - 11-20-2008

[eluser]stensi[/eluser]
Thanks for the warm welcome back all!

I've got a pretty long list of changes planned for the next version, of both major and minor things. One of the priority changes will be to reduce the total number of database queries for related objects (see OverZealous.com's and commandercool's comments about a where_related/join_related method). This one will require a fair bit of testing though so will increase the development time of the next version.

@OverZealous.com, @commandercool: If you guys could let me know any further findings you've had with your work on reducing database queries, or any other recommendations, it would be much appreciated! ;-)

@Mortred: The Server Requirements of DataMapper states that PHP5 is required. It requires PHP5 because DataMapper uses several PHP5 only objects/functions. If you want to use it in PHP4, you will need to make a number of changes although I'm sorry to say I can't help you with this since I haven't attempted to run it in PHP4 so don't know what those changes will be and also, I would rather only support a PHP5 version. Sorry.

@cahva: Thanks for choosing DM and yes, you can indeed be confident with your choice since if you do happen to run into any concerns related to DM, just let us know here and you'll get the help you need. DM is always being improved and performance tuned so it will only get better :-)


DataMapper 1.6.0 - El Forum - 11-20-2008

[eluser]ntheorist[/eluser]
@stensi

good to see you back. hope you had a great time in Japan Tongue

yeah, since you've been gone i've been working on DM and so far i think i'm making some progress, but it can be slow, painstaking work for sure.. I'm integrating it into a larger system i'm building too, and i've sorta been trying to put together a Datamapper framework with several specific extending classes and such. i'm actually working on some more of it today and hope to get to a stopping point tonight.

I'll post the changes i've made so far soon after i get through testing everything, and see what you think. Yeah, I'm focusing mostly on reducing/optimizing queries and sql statements, enhancing relationship configuration, integrating the new validation library, adding a few helpful methods and looking for any spots to improve php performance.

Also at some point I think it'd be a good idea to go through and try to optimize everything for php5, declaring visibility for security etc.. although i'm not totally fluent in php5's object language but i'm learning as i go.

ok back to work..

CC