Wednesday, November 3, 2010

Re: How strict is your approach towards convention over configuration?

On Nov 3, 9:32 am, Enno Weichert <enno.weich...@googlemail.com> wrote:
> Hi,
>
> I have to integrate a very bad legacy database where field names are
> named inconsistently (like contact, Kontakt, contactID, contact_id,
> KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
> one table).
> I would have to reflect all that in the models so I'd not have to use
> that crap anymore.
> So: how many of the fied references in your code are hard-coded? What
> obstacles will I see? How much can I configure and still play cakephp?
>
> Thanks,
> Enno

why don't you just create a view (assuming you can't edit the actual
tables).

I.e. CREATE OR REPLACE· v_tablename AS as SELECT funky AS id, ext AS
group_id .... FROM optionalotherdatabase.tablename

and use that instead of the real table. If you create simple views (no
joins, basically) you can also update them.

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: