Forking for this particulare topic:
On 12/24/19, 6:46 AM, "Carlos Rovira" <[email protected]> wrote:
...Why I think we need to solve is if we have a better way
to extend UIBase, better than StyledUIBase path, since I'm not very happy
with it.
The worst problem I see is that all we can do in UIBase, other UI sets will
need to add in at least 4 points:
- An UIBase extension
- A Group extension
- A Container extension
- A DataContainerBase extension
It's that right? or do you see other way, less complicated to add new
functionality to a visual element?
I have not looked at Jewel's code. What ended up needing to be copied?
There might be other issues causing pain here. For example, I wouldn't be
surprised if we've unintentionally used concrete classes instead of interfaces
in places in Basic.
On the other hand, the MXRoyale and SparkRoyale components are good indicators
that composition is working reasonably well in Basic. Lots of Basic classes
are repurposed on top of a completely different class hierarchy although UIBase
is at the bottom. IOW, MX and Spark Containers and Groups do not subclass
Basic's Containers and Groups. Things are re-composed.
That said, there is still a fair amount of duplicated code scattered around the
repo. If it weren't for function call overhead, I'd be tempted to move more
method bodies into re-usable utility functions, plus, those functions lose
scope. Injecting code into classes generally has too much overhead and I
prefer "sealed classes" over runtime-modifiable definitions (Java Aspects) for
code-security reasons, but on the other hand, we might consider getting the
compiler to do compile-time code injections.
Also, I compiled HelloWorld the other day and HelloWorld.js in bin/js-release
was more than 90K. That made me very sad. I could swear the original
prototype was 27K, possibly less. We've more than tripled the amount of
useless code. If I ever find time, I'm going to go pruning again. And having
more options on how to use composition will probably help here as well.
I may be slow in keeping up on this fork because of the holidays and some other
pressing issues, but I think it would be good to look at what was needed to get
Jewel up and what we might do better.
My 2 cents,
-Alex