developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
Opened 13 years ago
Last modified 9 years ago
#642 confirmed new feature
jDaoFactoryBase should purpose intuituve methods
Reported by: | bastnic | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | jelix:dao | Version: | trunk |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | no | |
Hosting Provider: | Php version: |
Description
In django and ruby on rails they are some "models" method which use regexp to directly create some dynamics methods. Example :
if I call something like
$mydao->title_beginWith("toto"); $mydao->title_endWith("toto"); $mydao->title_contain("toto");
or
$mydao->category_beginWith("miaou");
"title" and "category" are fields of the current dao.
We can use the magic class method call and test the name of functions, test if field exists and then generate the SQL code.
What do you think about that (bibo ant laurentj seems to be agree, we talk about that at the RMLL where you don't come :p)
Change History (7)
comment:1 Changed 13 years ago by bastnic
- Type changed from bug to new feature
comment:2 Changed 13 years ago by bballizlife
comment:3 Changed 13 years ago by laurentj
For performance issues, we can do this :
- adding support of some attributes on field element, to indicate we want to generate méthods *_beginWith etc... ( searchOn="begin,end,contains" ? ), or a <method type="property_search" how="begin"> ...
- adding implementation of call method, so, if the developer forgot to specify attributes/method element, it still works.
comment:4 Changed 13 years ago by laurentj
- Milestone set to Jelix 1.2
comment:5 Changed 12 years ago by bballizlife
I'm very late to answer to this...
Ok agree with laurentj proposal, seems very nice to me. So bastnic, you can patch ;)
comment:6 Changed 11 years ago by laurentj
- Milestone Jelix 1.2 deleted
comment:7 Changed 9 years ago by laurentj
- Status changed from new to confirmed
On the user side, i think this features should be great.
To be a little bit more explicit :
On Jelix side : would this methods will be created on the fly or integrated in the dao compiled file ?
As i said, i'm ok for this. The only thing we should take care of is performance issues. Does creating and calling methods on the fly not too counter-productive ? If generating the methods in the dao compiled file, wouldnt it be to overweighted ?
(i was not at the RMLL so i don't know about your discussion and if you talk about the implementation).