1. #1
    Ext User
    Join Date
    May 2007
    Location
    Brasília, DF, Brasil
    Posts
    17
    Vote Rating
    0
    daniel.rochetti is on a distinguished road

      0  

    Lightbulb New Java API idea: ext4j

    New Java API idea: ext4j


    Hey you all!

    I think there are a lot of people here that use Ext with Java on the server side. Last week I started the development of ext4j (that the name I gave, suggestions of a better name are welcome). The ideas of this API are:

    - To provide a set of custom tags to make Ext development on the client side easier (even easier for those who don't have Javascript experience). Some of the custom tags I've already started to develop are: ext4j:form, ext4j:textfield, ext4j:numberfield, ext4jelect, ext4j:button, ext4j:grid... I'm using freemarker templates to generate the necessary code, so it's easily customized and I'mt trying to keep it as accessible and unobtrusive as possible (see my other post).
    - To provide integration with the most used Java frameworks such as Struts2/WebWork (already start to develop this integration and the first tests gave great results, I'm able to use the standards Struts tags such as s:form, s:textfield and get the content generated with Ext functionalities), DWR, JSF and others.
    - To provide integration with any I18N adapter (JSL, Struts...) that is being used.
    - Some annotations to deal with forms in a easier and interactive manner (I'll explain this one better later).

    This weekend I'll finish the Maven configuration and will commit the project to any Subversion or CVS available (any suggestions???). The idea is to have a well-documented project, easy to use and to plug in any project. I'd like some suggestions and to know people that are interested in participate in this project. Thanks for the attention again people! Up the Ext! Cya!

  2. #2
    Ext User
    Join Date
    May 2007
    Posts
    1
    Vote Rating
    0
    satishmummadi is on a distinguished road

      0  

    Thumbs up I am in :-) for EXT4J

    I am in :-) for EXT4J


    Dear Daniel,

    Nice to see your post, I have been using Yahoo UI, EXT a lot for developing new JSF/Facelets Components,(Facelets is a templating framework); I use Ext a lot that's integrated with Server side J2EE.

    I Love the idea and will be looking forward to help.
    I am looking forward for the maven configuration

    Happy Ext.
    Satish

  3. #3
    Ext User DavidHu's Avatar
    Join Date
    Apr 2007
    Posts
    12
    Vote Rating
    0
    DavidHu is on a distinguished road

      0  

    Default


    Hi Daniel,
    I don't think the custom tag is a good idea. Forget the Struts, WebWork and JSF, there are out.
    Write Ext's style codes are quite simple and elegant.
    I have already written a java framework to integrate ext and java.
    The core idea is there is a JsonServlet that support the JSON data serialize/deserialize. And call backend java service or actions. That

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    On the contrary, I think custom tags are an excellent idea. They can be used to encapsulate a load of design-time instructions and when executed, can collect metadata about their attributes, and create complex markup and script.

    I think a fully integrated Java/Ext framework is an excellent idea.

    I'd like it to also integrate Hibernate for easy access to a database.

    With Hibernate, it would be a doddle to create a tag which could create a Grid from tags and attributes that are an analogue of Hibernate capabilities like the Hibernate "Criteria", "Restrictions" and "Projections" classes:

    Code:
    <ext4j:Grid entity="Customer">
        <ext4j:column property="name" header="Name" width="100"/>
        <ext4j:column property="language.name" header="Language" width="100"/>
        <ext4j:restriction type="LIKE" property="area.code" value="NG%"/>
        <ext4j:order property="name" direction="ASC"/>
    </ext4j:Grid>
    Which would result in

    Code:
    List results = session.createCriteria(Customer.class)
        .setProjection(
            Projections.projectionList()
            .add( Projections.property("name"))
            .add( Projections.property("language.name"))
        )
        .add( Restrictions.like("area.code", "NG%") )
        .addOrder( Order.asc("name") )
        .list();
    And "results" would be a java.util.List of Object[] where each Object in the array was the column value.

    That could be exported via DWR, or Json or XML.

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    I agree with David. Why try to write an app in a tag language? You end up with something very cumbersome and difficult to maintain. Why write the UI in Java at all when JavaScript can be so much faster to develop with?

    I agree that shortcut tools on the server side are needed for building datasets, server-side validation, etc but I think writing the UI layer in JavaScript will get you to the end goal - a full featured web app - much faster than trying to write it on the server and generate the JS.
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  6. #6
    Ext User
    Join Date
    May 2007
    Posts
    1
    Vote Rating
    0
    AlexKiss is on a distinguished road

      0  

    Default Writing web apps on the server side

    Writing web apps on the server side


    Hi to All,

    To utilize the full potential of Ext a developer has to master Javascript to a certain degree. Server side wizardy is not enough.

    On the other hand if someone would like to develop a basic EXT based app having a tag based server side approach can be a big help for developers.

    My company is evaluating Ext at the moment to use it in a product. Since most of the developers are highly trained in SQL and business logic development, but lack the expertise in javascript, we may have to develop server side controls for them. (We are in the .Net world. )

    Alex

  7. #7
    Ext User
    Join Date
    May 2007
    Location
    Brasília, DF, Brasil
    Posts
    17
    Vote Rating
    0
    daniel.rochetti is on a distinguished road

      0  

    Default


    Hey!
    DavidHu, why don't you think that custom tags is a good idea? You just said it, you didn't argue... I didn't get your point, or maybe you didn't get mine. Like Animal said custom tags can be used to encapsulate a load of design time. Imagine a web developer that can use the power of the Ext grid without knowing Javascript. And plus you can get the content generated with valid HTML (a important thing to me and to the future of the Web). So the idea of the framework is not to provide only server-side integration with Java but also make it easier on the client side, the UI.
    And again, why not provide integration with well-spread-known frameworks like Struts, DWR, etc? I want to provide an ext4j integration on the server side (something like the JsonServlet you've mentioned) to use it as a stand-alone framework, but imagine a project that is already using a framework and want to use ext4j? Also, imagine an big organization that has a well defined architeture and they must use Struts2 (that's my case, for example) and they want to use ext4j... so I see the ext4j integration with famous frameworks a MUST HAVE feature... I've already implemented part of the Struts2 integration and it's working great!

    Animal, those are really good ideas! I'll set up the project and then we can start to discuss the scope for the first version... my ideas:
    - custom tags: form, textfield, numberfield, datefield, select, textarea, checkbox, radio, button (togglebutton), grid, collumn, editableColumn (not sure about this one), tabbedPanel, tab, toolbar, menu, menuItem (maybe subclasses of it too), tree (not sure how to design this tag yet), dialog (not sure about this one too)... and some layout tags maybe
    - provide a request handler that output data (java objects) as JSON (a very simple implementation to use ext4j as the only framework;
    - provide integration with frameworks, initially: Struts2/WebWork, JSF, DWR, Hibernate

  8. #8
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Quote Originally Posted by jack.slocum View Post
    I agree with David. Why try to write an app in a tag language? You end up with something very cumbersome and difficult to maintain. Why write the UI in Java at all when JavaScript can be so much faster to develop with?
    *cough backbase... *cough mxml... *cough.

    scuse me.

  9. #9
    Ext User DavidHu's Avatar
    Join Date
    Apr 2007
    Posts
    12
    Vote Rating
    0
    DavidHu is on a distinguished road

      0  

    Cool


    Hi Daniel & Animal

    As you said, the JSP custom tags can encapsulate some logic and auto generate some codes for common programmers. These tags do reduce the client side code lines. But the custom tags also have drawbacks:
    1. The custom tag will lead the client side codes to a complex program model. These tags can't handle all things, they must integrate with JavaScript.
    2. The custom tag is hard to extend for users. These tags define a rule, all things must obey the rule, and otherwise, they need another tag. Please see example below.
    3. Custom tags also need time to learn. More features your tags can support, more hard to learn your tags. At the same time, the programmers also need to learn EXT.
    A clean and simple client side programming model can also reduce programmers

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Interesting concepts David. I like the idea of a HibernateStore which provides access to an org.Hibernate.Query. I'll give that some thought at work.

    But tags are simple for, as you put it "common programmers" who are the ones I'm really thinking about. We are going to have probably in the thousands of pages in the app eventually. Our current application is very large. And the people who will be writing it and maintaining it are ... well... "pedestrians"?