Wednesday, November 3, 2010

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

sorry I started two threads...
"How do I map legacy _field_ names to better suited (read Cake-like)
ones?" is the other one.

short: Cake will play nice with anything the problem is: the field
names are horrible and I don't want to see them.
But (as I posted in the other thread) there are some problems:
1. I cannot use mysql views
2. I cannot change the schema
3. I cannot do my own thing
4. just introducing the table name, id and foreign keys is not enough
given the horrible field names - I'd also have to promote different
ones for them

I thought of doing something nifty on the ORM level or something...

also: I'd love to close that thread... ;-)

On Wed, Nov 3, 2010 at 8:17 PM, nurvzy <nurvzy@gmail.com> wrote:
> That's really clever AD. I was going to say you can edit all custom
> foreign keys in the models and joins and cakephp will play nice, but
> creating database views is a pretty slick approach I hadn't thought
> of.
>
> Nick
>
> On Nov 3, 8:39 am, AD7six <andydawso...@gmail.com> wrote:
>> 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
>

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: