You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2015/04/10 04:23:12 UTC

[FlexJS] The Big Rename

Now that the defineProperty change has landed, the next thing I want to do
is rename a bunch of classes and other things to better organize the
components.

I generally don’t care too much about naming schemes, whatever name you
can remember things by is fine with me.  So suggestions are definitely
welcome, and this doesn’t have to be the last chance to rename something:
we can rename things later as well.

So far, the things I want to change are:

1) Change the default xmlns prefix.  Currently, the mxml is littered with
the “basic:” prefix.  In the past, we discussed using “fjs:” instead.
Today, I’m thinking of just use “js:”.  IMO, the prefix really should be
short.  I’m not sure the “f” buys us anything.  The “js” indicates that
these components are intended to be cross-compiled.  The prefix doesn’t
denote a particular set of components, the URI it is mapped to determines
the set of components.  Thus, it should be possible to swap in a set of
Jquery components not by changing the prefixes in your app, but by
changing the URI of the default namespace.  IOW, if the default namespace
maps to the default component set like this:

  xmlns:js="library://ns.apache.org/flexjs/basic”

You can switch to the Jquery component set by changing it to:

  xmlns:js="library://ns.apache.org/flexjs/jquery”

Yes, you may need to fix up any API differences, but no need to change the
prefix on the tags in the MXML.


2) More SWCs.  I’m going to split out the Jquery and CreateJS components
into their own SWCs.  I’m also considering separating classes that don’t
have any ties to a component set out into a core.swc.  So the utils
package, the events package, binding classes, maybe HTTPService and
Collections.

3) Shorter names for commonly used classes.  I’m going to leave the
top-level components untouched, but I’m going to rename the layout
classes.  Right now they are called things like
NonVirtualHorizontalLayout.  That is just going to become HorizontalLayout
and whenever we write the virtual HorizontalLayout it will be called
VirtualHorizontalLayout.  And yes, that means that there will be a
HorizontalScrollingLayout and VirtualHorizontalScrollingLayout class some
day.  I considered a more strict naming scheme where additional features
are appended to the name, but it doesn’t quite feel right.  In such a
scheme, the most common lightest-weight class has the shortest or most
obvious name, so HorizontalLayout “could” still be the default for a
layout that lays its children out horizontally, and then one that does
virtual layout would be called HorizontalLayoutVirtual.  Or to really
apply such a scheme strictly, HorizontalLayout would be called
LayoutHorizontal and the virtual version would be LayoutHorizontalVirtual
and LayoutHorizontalScrollingVirtual.  Yes, it makes thing easier to find
in the index, but it didn’t feel “natural” to me.  But I’m willing to go
that way if folks want to.

OK, that’s what I’ve thought of so far, but there could be more as I get
into it.  Let me know your thoughts.

Thanks,
-Alex