Welcome Guest, Not a member yet? Register   Sign In
Super Ultra Mega Dynamic Menu Post - all gurus and no gurus invited
#18

[eluser]MEM[/eluser]
[quote author="jedd" date="1257008108"]
Okay, let's call this the fifth reason why names are less attractive than ID's here - you have to do an extra database hit on the way in to convert your name to an ID, and then on the way out again to convert the ID to a name. Yes, you have to do those kinds of lookups in either case - but they're more likely to be embedded in a single SELECT/JOIN if they're based on ID. Not a huge thing, of course, as database lookups like this are reasonably cheap, especially if you index your name column. Still, it's an additional level of indirection, and you have to contend with duplicate names (as discussed earlier) which is a problem you don't have with an ID field.
[/quote]

I still believe w3c as big point for wanting semantic URI segments. However, I do realise that, according to my knowledge, doing all properly: ie: w3c friendly AND provide a good performance, I need to give myself some experience first. Let's go for the id's then, and stick to them, without changing the URI to any names. (for now) :p

[quote author="jedd" date="1257008108"]
As to where you'd do this .. well, somewhere early on I would imagine. The constructor of your controller seems like a sensible place, assuming only one controller ever cares about this translation.
[/quote]
Of course! I was wondering, should I always need to have that controller method name on the URI? Or, the only way I have to remove that controller method from the URI is by routing?
No. We can always do that on the constructor.

[quote author="jedd" date="1257008108"]
Btw, 72 characters is the usual auto-wrap for email clients. Breaching that number can cause URL's to be split, and not all mail clients, particularly after a message has been replied/forwarded, will automatically join a URL that spans two lines.
[/quote]
Nice limit to have at sight then.



[quote author="jedd" date="1257008108"]I see that you've worked out routing. Or at least discovered it.

To answer one of your questions there - if you onlya nticipate future changes would be to add new things you want to route, then just negate your logic and don't route everything that fits your hard-coded and defined set of controller and/or method names.
[/quote]

I was unable to understand what do you mean here. I'm not that fluent on English.
Are you saying to: forget about routing on this case?
Can you please, re-state? (sorry Confused)



I will now try to create a work-flow process for this. And see what I get. My main difficulties will be with the retrieving of all parents and childs from a given id models. Let's see...


Regards,
Márcio


Messages In This Thread
Super Ultra Mega Dynamic Menu Post - all gurus and no gurus invited - by El Forum - 10-31-2009, 09:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB