|
Hi jon!
I am looking for a lightweight version of ECS.
Do you know if such packege already exist
I would like to use ECS like SW to generate on the fly HTML within
applets.
Then I pass the HTML generated string to a
javascript function to display it
This is not possible with the current version: 157KB
I think we can reduce it by streamlining the
current version.
For example we can avoid methods
like "public IMG
addElement(Element element)" which purpose seems only to save
typing.
An other example of optimization could consist in defining all
attributes as
final String (which are interned), for we can
write
TD td=new
TD();
td.addAttibute(ElementAttributes.ALIGN,AlignType.center);
td.addAttribute(ElementAttributes.WIDTH,20);
with the ElementAttributes class defining
public static final String
ALIGN="align";
public static final String
ALIGN="width"; and other commn
attributes public TD setAlign(String
align)
{ addAttribute("align",align); return(this); } of course this version could
require more typing, but the main benefits of ECS are still preserved: closing
tags, objects and subcalssing object could be easier. And
subclassing is the usual way I worked with ECS. For example, I rarely use TD as
is, but a MyTD class where I define common things for all my TDs. The same apply
for tables, Document, ... since all classes are extending ElementAttributes, we can omit ElementAttributes for constants
and it becomes more readable
This could be an optimisation even for the current version, by
saving memory allocation time and size
|
- Re: lightweight version of ECS Daniel HERLEMONT
- Re: lightweight version of ECS John Ky
- Re: lightweight version of ECS Stephan Nagy
