--- In [email protected], "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> Tom is correct. The compiler starts out from the root class (i.e.
> typically your subclass of mx.core.Application) and resolves types as
> needed. Types can be found in source path(s) or library path(s). This is
> why mxmlc enforces the "one public definition per file" rule and also
> establishes the convention of "a sub-package is a sub-directory" as it
> makes type resolution from sources predictable. Both of these
> conventions are Flex specific and not inherent to the ActionScript 3.0
> language.

It is interesting to know how the flex compiler works, thank you for
the explanation.

> If it were the other way around then I guess you would have to create a
> project that explicitly added each source to the configuration (if we
> were to scan all sources then ActionScript include fragments would be
> invalid definitions etc...). That would seem more of an effort to me...
> If the tool were changed to scan all types, including non-referenced
> types, for [RemoteClass] metadata then your SWF would be unnecessarily
> large because you would start embedded classes that you never intended
> to use.

Peter, why should the size of the SWF increase unnecessarily including
all the classes marked with [RemoteClass] metadata?

I suppose that the great majority of the framework's classes don't
make use of this feature, so the only additional classes included in
the binary would be the project-specific ones, and this seems exactly
the expected behaviour to me - tipically those classes are the DTOs of
my application and I'll likely need them anyway.

I still think that referencing all the classes by hand in my code is
not really a viable solution.. even if I choose to declare a reference
for every server object I work with in my MXML components, I have also
to declare a reference for each subclass of it (my DTOs are usually
extending other ones), and this is not the level of knowledge of my
services that I want to keep in mind when coding a Flex front-end for
them. As I said in a previous post, a way to include an entire package
of classes (compiler switch/ide support) would at least allow us to
setup this when starting a new project and then to forget about it.

Anyway, I think Flex is a great product, and this is probabily the
only real issue I found until now :)

Cosma



Reply via email to