> on 5/8/2000 8:07 AM, Maciek Kaminski 
<[EMAIL PROTECTED]> wrote:
> 
> > For some time I have been experimenting with using component
> > application model with Turbine. Whole user interaction is 
handled
> > via events.
> >
> > It is more radical than adding ActionEventListener to Action but
> > you migth find it interesting.
> 
> right...i think that is taking things to far. i think it makes the code 
to
> complicated for others to work with. especially newer engineers...
This is a matter of taste. I can't think of any more smiple way to 
express this. 
> 
> > DefaultContainer c = new DefaultContainer();
> > 
> > final HText text0 = new HText("Hello World.");
> > final HText text1 = new HText("Number of hits: " +
> > numberOfHits);
> > HLinkButton button = new HLinkButton("Hit me!", true);
> 
> I hope that on the back end you are wrapping these things 
around ECS and not
> just re-creating it! :-)
Sure. Look at the code.
> 
> Also, the problem with this is that you are not creating a fully 
MVC model
> where ALL of the HTML is in the template files. in other words, if 
you want
> to change the name of a button or some text, you still need to 
edit the java
> class file.
It is a matter of implementation. I may use (some) template 
system during rendering stage.

I agree that look customization is important problem with this 
approach. It still needs a lot of ideas/work.
> 
> with the recent tighter integration with WebMacro and 
Freemarker, I think
> that we have proven that using a template tool is a much better 
solution
> than putting any of the html (even just button names) into the 
java code.
> 
> it took some trying to get it right, but i think we are pretty close 
now.
> with Scarab, i have 99.9% MVC abstraction. there is zero things 
about the UI
> model that cannot be edited by page designers. so far, the only 
thing that
> is being embedded in the code is some error messages and 
eventually those
> will get Localized out so i will have 100% MVC.
> 
> > button.addActionListener(new ActionListener() {
> > public void actionPerformed(ActionEvent event) {
> > numberOfHits++;
> > text1.setValue("Number of hits: " + numberOfHits);
> > }
> > });
> 
> Personally, I just don't like code like this. I find it pretty hard to 
read.
People who have some experience in Swing programming find it 
easy.

Again, It is a matter of taste. It is one piece of code. In 
screen/action model one needs two classses.

It does not make much sense to use components for simple 
things. They make things simple when you want something 
complicated:

public class Table extends DefaultPaglet implements Paglet {

    public void init(Object o) {

        Object[][] data = {
            {"AA", "AB", "AC"},
            {"BA", "BB", "BC"},
            {"CA", "CB", "CC"},
            {"DA", "DB", "DC"}
        };

        String[] columns = {"C1", "C2", "C3"};

        DefaultTableModel tableModel = new DefaultTableModel(data, 
columns);

        TableColumnModel columnModel = new 
DefaultTableColumnModel();

         columnModel.addColumn(new TableColumn(
             0, "C1", "C1", true,
             new DefaultRenderer(), new DefaultEditor(30)));

         columnModel.addColumn(new TableColumn(
             1, "C2", "C2", true,
             new DefaultRenderer(), new DefaultEditor(30)));

         columnModel.addColumn(new TableColumn(
             2, "C3", "C3", true,
             new DefaultRenderer(), new DefaultEditor(30)));

        HTable table = new HTable(tableModel, columnModel);
        table.setEditable(true);
        addComponent(table);
    }
}

Maciek Kaminski
[EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to