Extending built-in datatypes

Extending built-in datatypes

Thursday 10 January 2008 11:59:24 pm - 2 replies

Modified on Friday 11 January 2008 12:19:15 am by Piotrek Karaś

Author Message

André R.

Friday 11 January 2008 12:58:10 am

> Is extending built-in datatypes when creating a custom datatype a good idea? Example:
Depends one the probability of big changes in the datatype in the future.

> I've used it before, but recently came across a problem - the extended datatype was not found.
1. make sure the class is in the autoload array "autoload/*"
2. if not, simply include it like you did in ezp3.x

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Piotrek Karaś

Friday 11 January 2008 1:58:36 am

> Depends one the probability of big changes in the datatype in the future.

Yes. I'm thinking of extending instead of creating from scratch when I only need to slightly adjust the built in functionality, for example to provide additional validation rules. URL is a good example, because it is quite a complex datatype with core functionality that I want to still rely on, I just need little extra protection. I expect this way to be much easier to maintain when changes are introduced to datatypes in future versions. Do you think I miss something?

Thanks for the help,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.