Re: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-09 Thread Stephen Downs
I originally was all go to separate the view and code using the  
source prop in a script tag. What i didn't like about this was that  
it was a loose link. Code behind makes this a more solid link but  
after experimenting with that also i've found I end up with some many  
files open it begins to turn into a negative.


I've settled on putting code in a script block. For me it makes  
things more manageable and I really don't see the problem with having  
the functionality for that component inside it (just like all the  
classes in the framework (i.e. they don't have an AS class for the  
functionality, and then an AS class extending that which creates the  
view items)).


cheers

Tink





On 8 Feb 2007, at 21:20, Ralf Bokelberg wrote:

What is your reasoning to use code behind? Why would you want to  
double every class and add an additional inheritance layer just to  
separate Mxml from ActionScript? Why would you want to declare  
every component you are using twice, once in AS and the second time  
in Mxml? Is it to separate presentation from functionality?  
Generally this is a good idea, but i think it is important where to  
draw the line between the two. When you think of traditional  
systems with a template engine as the presentation layer, the  
templates also contain some code to build the presentation, while  
the functionality is implemented by plain classes. Now if we  
translate this thinking to Mxml and ActionScript, we should leave  
all the code we need to build the presentation inside the Mxml  
files and factor out the real functionality into classes. So i'd  
say, there is nothing wrong with ActionScript in Mxml files as long  
as it is strictly presenation related.


Cheers
Ralf.



On 2/8/07, Mike Anderson <[EMAIL PROTECTED]> wrote:
Hello All,

Could some of you more savvy coders, please take a moment of your
valuable time and throw some words of wisdom out there regarding
CodeBehind?

Since I love using Packages and Classes, it feels very natural for  
me to

use this method.

BUT, based on where things are going with Flex, is this considered  
to be

a "good programming practice"?

I would love to know sooner versus later, so that I don't have to back
and redo a bunch of coding. I am a REAL stickler when it comes to good
coding practices.

Thanks in advance for your time on this,

Mike




--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35






RE: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Gordon Smith
I must admit that I just don't understand the interest in code-behind.
When you write

 

MyComponent.mxml:

 





public var foo;

public function bar():void { ... }





 

you are writing a subclass (of Canvas in this case) and declaring a
property foo and method bar() of that subclass. It's just MXML notation
for

 

public class MyComponent extends Canvas

{

public var foo;

public function bar():void { ... }

}

 

So if you love packages and classes, what's the problem with
?

 

- Gordon

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Anderson
Sent: Thursday, February 08, 2007 11:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] What's the "official" consensus of using
CodeBehind??

 

Hello All,

Could some of you more savvy coders, please take a moment of your
valuable time and throw some words of wisdom out there regarding
CodeBehind?

Since I love using Packages and Classes, it feels very natural for me to
use this method.

BUT, based on where things are going with Flex, is this considered to be
a "good programming practice"?

I would love to know sooner versus later, so that I don't have to back
and redo a bunch of coding. I am a REAL stickler when it comes to good
coding practices.

Thanks in advance for your time on this,

Mike

 



RE: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Mike Anderson
YES, all these points you bring up in your post, are the things flying
through my mind.
 
It's like having to maintain twice as many files, just for the purpose
of creating a clean separation of the two.  This is why I am torn, and
wanted to ask everybody else.
 
I was fortunate enough to be introduced to Cairngorm from the very
beginning, and as painful as it was, wrapping my head around it while
learning Flex too, I am SO happy that I did it.
 
So, I want to make sure I do the same thing with CodeBehind - because it
really would mean a huge task of recoding applications.  I just need to
know for what?  Peace of mind?  Well, maybe :)
 
Thanks everybody for contributing to this thread - and I know this was
just discussed not too long ago, but the end result really didn't lean
one way or another.
 
Mike



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ralf Bokelberg
Sent: Thursday, February 08, 2007 3:20 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] What's the "official" consensus of using
CodeBehind??


What is your reasoning to use code behind? Why would you want to double
every class and add an additional inheritance layer just to separate
Mxml from ActionScript? Why would you want to declare every component
you are using twice, once in AS and the second time in Mxml? Is it to
separate presentation from functionality? Generally this is a good idea,
but i think it is important where to draw the line between the two. When
you think of traditional systems with a template engine as the
presentation layer, the templates also contain some code to build the
presentation, while the functionality is implemented by plain classes.
Now if we translate this thinking to Mxml and ActionScript, we should
leave all the code we need to build the presentation inside the Mxml
files and factor out the real functionality into classes. So i'd say,
there is nothing wrong with ActionScript in Mxml files as long as it is
strictly presenation related. 

Cheers
Ralf. 



On 2/8/07, Mike Anderson <[EMAIL PROTECTED]> wrote: 

Hello All,

Could some of you more savvy coders, please take a moment of
your
valuable time and throw some words of wisdom out there regarding
CodeBehind?

Since I love using Packages and Classes, it feels very natural
for me to
use this method.

BUT, based on where things are going with Flex, is this
considered to be
a "good programming practice"?

I would love to know sooner versus later, so that I don't have
to back
and redo a bunch of coding. I am a REAL stickler when it comes
to good
coding practices.

Thanks in advance for your time on this,

Mike







-- 
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35  


Re: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Diego Guebel
IMHO, I think it was very helpful in Flash & Arp ages. As the view was  
binary code and was very handy to have the code in classes to be able to  
support version control, unit test, etc.
But now since mxml is also a text file I think it does not have too much  
sense to do that.
Besides that you should re-declare all the components you have on the mxml  
in the class.

Just my 2 cents,
Diego


On Fri, 09 Feb 2007 10:27:34 +1300, Ralf Bokelberg  
<[EMAIL PROTECTED]> wrote:

> and last but not least you can put your Mxml files into packages just  
> like
> classes - that's what they really are after all: classes.
> Cheers
> Ralf
>
> On 2/8/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:
>>
>> This is just my personal view though, i'm not aware of an "official"
>> version.
>> Cheers,
>> Ralf.
>>
>> On 2/8/07, Ralf Bokelberg < [EMAIL PROTECTED]> wrote:
>> >
>> > What is your reasoning to use code behind? Why would you want to  
>> double
>> > every class and add an additional inheritance layer just to separate  
>> Mxml
>> > from ActionScript? Why would you want to declare every component you  
>> are
>> > using twice, once in AS and the second time in Mxml? Is it to separate
>> > presentation from functionality? Generally this is a good idea, but i  
>> think
>> > it is important where to draw the line between the two. When you  
>> think of
>> > traditional systems with a template engine as the presentation layer,  
>> the
>> > templates also contain some code to build the presentation, while the
>> > functionality is implemented by plain classes. Now if we translate  
>> this
>> > thinking to Mxml and ActionScript, we should leave all the code we  
>> need to
>> > build the presentation inside the Mxml files and factor out the real
>> > functionality into classes. So i'd say, there is nothing wrong with
>> > ActionScript in Mxml files as long as it is strictly presenation  
>> related.
>> >
>> > Cheers
>> > Ralf.
>> >
>> >
>> > On 2/8/07, Mike Anderson < [EMAIL PROTECTED]> wrote:
>> > >
>> > >   Hello All,
>> > >
>> > > Could some of you more savvy coders, please take a moment of your
>> > > valuable time and throw some words of wisdom out there regarding
>> > > CodeBehind?
>> > >
>> > > Since I love using Packages and Classes, it feels very natural for  
>> me
>> > > to
>> > > use this method.
>> > >
>> > > BUT, based on where things are going with Flex, is this considered  
>> to
>> > > be
>> > > a "good programming practice"?
>> > >
>> > > I would love to know sooner versus later, so that I don't have to  
>> back
>> > > and redo a bunch of coding. I am a REAL stickler when it comes to  
>> good
>> > > coding practices.
>> > >
>> > > Thanks in advance for your time on this,
>> > >
>> > > Mike
>> > >Messages in this topic
>> > >  
>> (
>> > > 1)  Reply (via web post)
>> > >  
>> |
>>   
>> Start
>> > > a new topic
>> > >  
>> 
>> > >   
>> Messages
>> > >  --
>> > > Flexcoders Mailing List
>> > > FAQ:  
>> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>> > > Search Archives:
>> > > http://www.mail-archive.com/flexcoders%40yahoogroups.com
>> > >  [image: Yahoo!  
>> Groups]
>> > >  Change settings via the  
>> Web(Yahoo!
>>   
>> ID required)
>> > > Change settings via email: Switch delivery to Daily  
>> Digest<[EMAIL PROTECTED]:+Digest>|  
>> Switch
>> > > format to  
>> Traditional<[EMAIL PROTECTED]:+Traditional>
>> > >  Visit Your Group
>> > >  
>> |
>>   
>> Yahoo!
>> > > Groups Terms of Use  |  
>> Unsubscribe
>> > > <[EMAIL PROTECTED]>
>> > >   Recent Activity
>> > >
>> > >-  111
>> > > New  
>> Members

RE: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Alex Uhlmann
I agree with Ralf's view and have recently blogged about it.
http://weblogs.macromedia.com/auhlmann/archives/2007/02/best_practice_c.
cfm
 
Best,
Alex
 

 

 

Alex Uhlmann 
Consultant (Rich Internet Applications)
Adobe Consulting
Westpoint, 4 Redheughs Rigg, 
South Gyle, Edinburgh, EH12 9DQ, UK
p: +44 (0) 131 338 6969
m: +44 (0) 7917 428 951
[EMAIL PROTECTED]
http://weblogs.macromedia.com/auhlmann

Adobe Systems Europe Limited | Registered office: 151 St. Vincent
Street, Glasgow G2 5NJ | Company No. SC101089

 

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ralf Bokelberg
Sent: 08 February 2007 21:25
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] What's the "official" consensus of using
CodeBehind??



This is just my personal view though, i'm not aware of an "official"
version. 
Cheers,
Ralf. 


On 2/8/07, Ralf Bokelberg < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

What is your reasoning to use code behind? Why would you want to
double every class and add an additional inheritance layer just to
separate Mxml from ActionScript? Why would you want to declare every
component you are using twice, once in AS and the second time in Mxml?
Is it to separate presentation from functionality? Generally this is a
good idea, but i think it is important where to draw the line between
the two. When you think of traditional systems with a template engine as
the presentation layer, the templates also contain some code to build
the presentation, while the functionality is implemented by plain
classes. Now if we translate this thinking to Mxml and ActionScript, we
should leave all the code we need to build the presentation inside the
Mxml files and factor out the real functionality into classes. So i'd
say, there is no! thing wrong with ActionScript in Mxml files as long as
it is strictly presenation related. 

Cheers
Ralf. 




On 2/8/07, Mike Anderson < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

Hello All,

Could some of you more savvy coders, please take a
moment of your
valuable time and throw some words of wisdom out there
regarding
CodeBehind?

Since I love using Packages and Classes, it feels very
natural for me to
use this method.

BUT, based on where things are going with Flex, is this
considered to be
a "good programming practice"?

I would love to know sooner versus later, so that I
don't have to back
and redo a bunch of coding. I am a REAL stickler when it
comes to good
coding practices.

Thanks in advance for your time on this,

Mike







-- 
Ralf Bokelberg <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> >
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35 




-- 
Ralf Bokelberg <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> >
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35 

 


att77266.gif
Description: att77266.gif


Re: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Ralf Bokelberg

This is just my personal view though, i'm not aware of an "official"
version.
Cheers,
Ralf.

On 2/8/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:


What is your reasoning to use code behind? Why would you want to double
every class and add an additional inheritance layer just to separate Mxml
from ActionScript? Why would you want to declare every component you are
using twice, once in AS and the second time in Mxml? Is it to separate
presentation from functionality? Generally this is a good idea, but i think
it is important where to draw the line between the two. When you think of
traditional systems with a template engine as the presentation layer, the
templates also contain some code to build the presentation, while the
functionality is implemented by plain classes. Now if we translate this
thinking to Mxml and ActionScript, we should leave all the code we need to
build the presentation inside the Mxml files and factor out the real
functionality into classes. So i'd say, there is nothing wrong with
ActionScript in Mxml files as long as it is strictly presenation related.

Cheers
Ralf.


On 2/8/07, Mike Anderson <[EMAIL PROTECTED]> wrote:
>
>   Hello All,
>
> Could some of you more savvy coders, please take a moment of your
> valuable time and throw some words of wisdom out there regarding
> CodeBehind?
>
> Since I love using Packages and Classes, it feels very natural for me to
> use this method.
>
> BUT, based on where things are going with Flex, is this considered to be
> a "good programming practice"?
>
> I would love to know sooner versus later, so that I don't have to back
> and redo a bunch of coding. I am a REAL stickler when it comes to good
> coding practices.
>
> Thanks in advance for your time on this,
>
> Mike
>  
>




--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35





--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35


Re: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Ralf Bokelberg

and last but not least you can put your Mxml files into packages just like
classes - that's what they really are after all: classes.
Cheers
Ralf

On 2/8/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:


This is just my personal view though, i'm not aware of an "official"
version.
Cheers,
Ralf.

On 2/8/07, Ralf Bokelberg < [EMAIL PROTECTED]> wrote:
>
> What is your reasoning to use code behind? Why would you want to double
> every class and add an additional inheritance layer just to separate Mxml
> from ActionScript? Why would you want to declare every component you are
> using twice, once in AS and the second time in Mxml? Is it to separate
> presentation from functionality? Generally this is a good idea, but i think
> it is important where to draw the line between the two. When you think of
> traditional systems with a template engine as the presentation layer, the
> templates also contain some code to build the presentation, while the
> functionality is implemented by plain classes. Now if we translate this
> thinking to Mxml and ActionScript, we should leave all the code we need to
> build the presentation inside the Mxml files and factor out the real
> functionality into classes. So i'd say, there is nothing wrong with
> ActionScript in Mxml files as long as it is strictly presenation related.
>
> Cheers
> Ralf.
>
>
> On 2/8/07, Mike Anderson < [EMAIL PROTECTED]> wrote:
> >
> >   Hello All,
> >
> > Could some of you more savvy coders, please take a moment of your
> > valuable time and throw some words of wisdom out there regarding
> > CodeBehind?
> >
> > Since I love using Packages and Classes, it feels very natural for me
> > to
> > use this method.
> >
> > BUT, based on where things are going with Flex, is this considered to
> > be
> > a "good programming practice"?
> >
> > I would love to know sooner versus later, so that I don't have to back
> > and redo a bunch of coding. I am a REAL stickler when it comes to good
> > coding practices.
> >
> > Thanks in advance for your time on this,
> >
> > Mike
> >Messages in this topic
> > 
(
> > 1)  Reply (via web post)
> > 
|
 Start
> > a new topic
> > 

> >  
Messages
> >  --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >  [image: Yahoo! 
Groups]
> >  Change settings via the 
Web(Yahoo!
 ID required)
> > Change settings via email: Switch delivery to Daily Digest<[EMAIL 
PROTECTED]:+Digest>| Switch
> > format to Traditional<[EMAIL PROTECTED]:+Traditional>
> >  Visit Your Group
> > 
|
 Yahoo!
> > Groups Terms of Use  | Unsubscribe
> > <[EMAIL PROTECTED]>
> >   Recent Activity
> >
> >-  111
> > New 
Members
> >
> >  Visit Your Group
> > 

> >  Give Back
> >
> > Yahoo! for 
Good
> >
> > Get inspired
> >
> > by a good cause.
> >  Y! Toolbar
> >
> > Get it 
Free!

Re: [flexcoders] What's the "official" consensus of using CodeBehind??

2007-02-08 Thread Ralf Bokelberg

What is your reasoning to use code behind? Why would you want to double
every class and add an additional inheritance layer just to separate Mxml
from ActionScript? Why would you want to declare every component you are
using twice, once in AS and the second time in Mxml? Is it to separate
presentation from functionality? Generally this is a good idea, but i think
it is important where to draw the line between the two. When you think of
traditional systems with a template engine as the presentation layer, the
templates also contain some code to build the presentation, while the
functionality is implemented by plain classes. Now if we translate this
thinking to Mxml and ActionScript, we should leave all the code we need to
build the presentation inside the Mxml files and factor out the real
functionality into classes. So i'd say, there is nothing wrong with
ActionScript in Mxml files as long as it is strictly presenation related.

Cheers
Ralf.


On 2/8/07, Mike Anderson <[EMAIL PROTECTED]> wrote:


  Hello All,

Could some of you more savvy coders, please take a moment of your
valuable time and throw some words of wisdom out there regarding
CodeBehind?

Since I love using Packages and Classes, it feels very natural for me to
use this method.

BUT, based on where things are going with Flex, is this considered to be
a "good programming practice"?

I would love to know sooner versus later, so that I don't have to back
and redo a bunch of coding. I am a REAL stickler when it comes to good
coding practices.

Thanks in advance for your time on this,

Mike
 





--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35