Hi JC,
Your solution is quite good. Using an 'Abstract Interface' is always
encouraged :)
The guideline goes like - 'Program to Abstraction not to Implementation'
Unfortunately AS3 does not (yet:) allow Generics / Collection Type
safety - so we are still forced to make sure we
do the right types, since Casting to the correct type will probably
be the biggest Problem for this code. ( MY opinion )
* 'Composite' is the formal Pattern Name for this type of
architecture - check it out - its worth it !!
BUT if you are planning on using components anyway, you might as well
build the app in Flex
which already offers this Architecture as the base of mxml / As3 code
gen and development.
'Abstract interface' for all Displayable Objects in Flex / AS3 is an
Interface called
- IFlexDisplayObject ( in flash its i believe 'Sprite' but dont nail
me on that :)
- UIComponent is the base class from which each Component MUST be subclassed
So if you use flex there would be no need for you to 're-invent' the
wheel :) no offense I dont mean to imply that you would not be capable
but if you are like me ( like a bit lazy :) you will find the offered
component framework in flex quite
AMAZINGLY GOOD !!!!
Your designer can change ANYTHING and EVERYTHING on the compos inside
the Design View ( No Coding !!! )
and you can glue functionality on the comps using DataBinding and a
robust event dispatching model.
As an Example - I built a VideoConference Tool Application( like
breeze or spreed ) - first in Flash 8 - I had to implement all
necessary compos so the designer could 'design' them creatively :) (
Man i wanted to kill that guy )
Sounded much like what you are planning on doing - I took me about 3
Months of just implementing compos - from a simple numeric stepper to
the expandable scroll Accordeon
- altogether around 24 components - boy it was a bitch - and then had
to add Domain Logic. Due to this enormous workload I completely
fragged the deadline - project was killed
For my own personal satisfaction I restarted the project myself -
this time in Flex and it took me about 6 - 7 months to complete it.
Now the Tool is in Beta and
running. Lesson for me was: Use Flex !!!! Unless you need to animate
or draw something - use Flex. It harnesses so much power !
And you can really concentrate on your business logic instead of
having to waste your time on building low-level application components.
AND even if you need to show something done in flash ( animated /
tweened / handdrawn ) you can import and display in Flex.
I hope I was able to answer your question right and to give you some
ideas / Suggestions.
Feel free to contact me if you have any questions regarding Flex / AS
3 , I'll be glad to answer them.
Best regards
Amir
Certified Flash Developer
Sun Certified Java Programmer (I.T.)
Am 07:32 AM 6/30/2007 schrieben Sie:
Hi,
we are looking into using another component set than the v2 architecture.
However we don't want to switch over and over again, and frankly as the
architecture developer I dont want anything to do with components at all.
So I was thinking about a setup where I write component interfaces such as
IComboBox and a set of wrappers such as V2ComboBoxAdapter implements
IComboBox.
Next a designer creates a view, and puts something in his view like (im
making it up as I'm typing) :
getComboBox (id:String):IComboBox {
return AbstractFactory.create (V2Adapters.COMBO_BOX, _root.cbPersons);
}
In terms of being independent of my views, I can just start putting an app
together and if the designer dude wants to skin it differently or use a
whole other component set he is free to do so, even mix and match is an
option.
The main thing I'm wondering about is whether I'm gruesomely
overcomplicating things and just causing a heckload of work for no good
reason other than that I am not familiar with a single very good component
set that satisfies all the designer needs (I'm not saying they don't exist,
I'm saying I don't have enough experience in any of them to make a
wellformed decision, and don't really have the time to test them one by
one:)).
Hope this makes any sense!
greetz
JC
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com