with My::Config; ## some runtime information, eventually for the trait's method has validDomain => ( isa => 'Str', is => 'rw', ); has alarmMailsTo => ( traits => ['ConfigEmail'], conf_key => 'ALARM_MAILS_TO' parameter_callback => 'validDomain' ## give a method name isa => 'ArrayRef[Str]', is => 'rw', ); .. ## Class role role My::Config { method load() { .. ## $attr is a Moose::Meta::Attribute my $parameter_callback = $attr->parameter_callback; $attr->parse($configString, $self->$parameter_callback()); .. } } ## Base Attribute Trait role My::Config::AttrBase { has parameter_callback => ( isa => 'Str', is => 'rw', required => 1, ); } ## Attribute Trait role My::Config::ConfigEmail with My::Config::AttrBase { method parse($value!, @parameters) { # now this is a more generic API } }