why do not you make your components implement an interface with these
methods you describe?


On Thu, Jan 29, 2009 at 10:54 AM, Jules Suggate <[email protected]>wrote:

>   Just to resume this thread, what I meant was to still use MXML and all
> the Flex components, but to introduce common functionality to all our Views
> (mxml files). Perhaps it's better to think of weaving this in than using
> inheritance, since that would require multiple inheritance AFAICT.
>
> I don't want anything fancy -- just a getter/setter pair:
>
> public function get model():IViewModel
> {
>    // some common code
> }
> private var _model:IViewModel;
> public function set model(value:IViewModel):void
> {
>    // more common code
> }
>
> To save writing out this code again and again, would I have to put this
> code in an include file, and include from each View?
>
>
> On Thu, Dec 18, 2008 at 06:41, Alex Harui <[email protected]> wrote:
>
>>    In theory, if your base class implements IUIComponent, then your
>> visual components will work in Flex
>>
>>
>>
>> *From:* [email protected] [mailto:[email protected]] *On
>> Behalf Of *Jules Suggate
>> *Sent:* Wednesday, December 17, 2008 8:56 AM
>> *To:* [email protected]
>> *Subject:* [flexcoders] Common base class for components
>>
>>
>>
>> Hi list, anyone know if it's possible to have all our components inherit
>> from a common base component of our own making?
>>
>> There are some things in our app that every View component will have to do
>> at loadtime, and it'd be nice to just write that code once and have all the
>> other components inherit it...
>>
>> Last time I checked in Flex 3 Beta 2 there was some vague suggestion of
>> using "Template Components", but that seemed like an afterthought in the SDK
>> at the time. Just thought I'd check to see if you knew of any tricks for
>> doing it :)
>>
>> Perhaps even an include file would be the way to go...
>>
>>
>
>
> --
> --
> Jules Suggate
> Owner and Technical Lead
> Uphill Sprint Limited
>
> +64-21-157-8562
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[email protected],

Reply via email to