incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Asset / i18n resource management improvements
Date Tue, 12 Jun 2012 21:33:08 GMT



On 6/12/12 12:47 PM, "Dirk Eismann" <bortsen@googlemail.com> wrote:

> Hi Alex,
> 
>> IMO, something like an "R" class should not be put into the compiler or the
>> IDE.  The compiler should be as framework agnostic as possible.  It is
>> probably possible to create a set of classes that do what R does.
> 
> maybe I misuderstand you here, but to get compile time code hinting in
> an IDE and compile time checking for resource accesses, I wonder how
> something like R should be generated then if not by the compiler?
To me, the most important thing to get right is the run-time implementation.
Once we nail that, someone will figure out how to get you something like
code-hinting.

Fundamentally, IMO, a string-only resource system is a simple lookup table
of a string key to a longer string.  Then for organizational purposes folks
tend to group those keys into bundles.

What we do today is bake classes for these bundles.  Then we install these
classes into a manager at startup time.  And we do that for error strings
you may never see, and Alert labels you hopefully will not see before the
first screen appears.  And the classes are actually quite big compared to
simply embedding a string table in the SWF (or loading the string table at
runtime).   Also, it isn't clear you need a class.  You might be able to use
simple dynamic objects instead.

And if we decide that classes have too much overhead and simply use dynamic
objects, what would then happen to code hinting?  There wouldn't be any
classes to hint.  How would you find spelling errors in the keys?  I'd hate
to see us drag down runtime performance just so you can get code-hinting.  I
think some IDE will someday be smart enough to look at the string tables and
help you get your keys right.


-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message