Discussions

News: Anvil 3.0 Open Source Web Application Platform Released

  1. Anvil is an open source web development platform that contains a rich object-oriented programming language with functional features including tag-based template language. Performance is compararable to JSP as all the code is compiled directly to Java bytecode. Anvil apps are deployable as a servlet or standalone.

    For summary of features, see http://njet.org/site/features/

    Binary and source distributions and documents available at http://njet.org/
  2. Hm... Another language, another syntax, simple examples with no serious functionality...

    Is it really worth it, or is it just another attempt to show off in a crowded world?
  3. Max,

    This was my impression exactly. Glad to see I wasn't alone. If there's more to Anvil than we can see at a quick glance, then they need to write a sample program to wow us. Otherwise we'll just yawn and move on, as we all have done.
  4. Of course I have a _very_ biased opinion but there is more than one sees by looking the Hello World example (which is what 90% seems to do.) I'd be interested to hear what kind of examples would you, or anyone else, would like see.

    In my opinion Anvil is best suited for quick application development, and it tries to be friendly for one who's doing to job, the programmer. Less noise, less code, less time.

    --jkl
  5. Jani,

    Show us how it lets us quickly fill a page with advanced GUI elements (navbars, hierarchical menus, tree controls, framed text boxes, calendars, tabbed panes, etc.). Show us how it offers convenient form field validation, both in JavaScript and on the server side. Show us how it lets you easily separate content from presentation so you can "skin" your Web application. Show us how the UI intelligently adapts its rendering for various browsers.

    Others will add their own wish list, I'm sure. But these are real-world issues that I face in Web development, which seem to be ignored by most frameworks/platforms. Does yours handle any of these? Another of my complaints about alternate Web frameworks: I make use of a variety of JSP Taglibs. Can I plug them into Anvil?

    These are all things you have to address if you want a platform like Anvil to be broadly acceptable. My quick look at Anvil made me conclude it was an alternative (maybe better) way to do a very basic set of things I can do just fine in JSP. What's the motivation to switch?
  6. I am happy to hear that someone actually looked at it for more than 30 seconds: if (content.startsWith("This is a new programming language")) throw new IAmSoBoredWithNewStuff();

    Those that have actually tried it have probably noticed that Anvil tags are not like JSP tags - tag attribute values actually get passed by reference, not via request/session namespace or string value. This applies to both builtin tags (if, foreach, eval..) and taglibraries build by other developers.

    You can also bind taglibs to empty namespace which allows you to hook html/wml tags to do cool things: like client parameter validation.

    Hook input tag to that your taglib gets called whenever input is printed on the screen so that you can easily fill in your own javascript kludges.. Of course some configuration info is needed here..

    Hooking of img tag can be cool also because you may change the src, and probably add onMouseOver imagechange automatically.

    What comes to the other stuff, I have been working on Component model for Anvil for 2 years now and I have spend quite a time thinking how all that stuff can be created as easily as possible.

    Currently only stuff on components that I have online is the tutorial:

    http://njet.com/docs/components/tutorial/index.nvl

    I plan on putting more info on if someone is interested.

    -Simo
  7. "Those that have actually tried it have probably noticed that Anvil tags are not like JSP tags - tag attribute values actually get passed by reference, not via request/session namespace or string value. This applies to both builtin tags (if, foreach, eval..) and taglibraries build by other developers."

    Actually, it's NOT true that JSP only sets tag attributes as string values, neither that they must come from the request or session. The JSP 1.2 spec, in section 2.13.2 explains the semantics for setting tag attributes. I have implemented many tags with attributes of non-string types.
    It is also possible to set attributes of any object type, without any conversions, when using request time expressions (ex.: <abc:if test="<%= returnsAList() %>">). Additionally, a JavaBeans <code>PropertyEditor</code> can be used to convert the string into any property type.
    So, no advantages for Anvil tags here.

    Anvil tags, on the contrary, are not as good as JSP custom tags. For example, consider this example, from the Anvil
    project:

    <my:iterate expr="anvil.system.getSystemProperties()">
      <tr>
        <td><my:key></td>
        <td><my:value></td>
      </tr>
    <my:/iterate>

    I see two problems here:
    1) The tags don't follow XML syntax. Both "<my:key>" and "<my:/iterate>" are not well formed XML (it should be "<my:key/>" and "</my:iterate>").
    2) The value for the "expr" attribute uses method call syntax, which is not desirable in web page code (which is why I don't use any kind of scriplet in JSP pages). It should be written as "expr=${anvil.system.systemProperties}" (in JSTL syntax, and also in the future JSP 2.0 standard), or something similar.

    As for hooking HTML/WML tags to Anvil tags, that can also be achieved with JSP custom tags, by means of the <code>BodyContent</code> interface.

  8. === 1) The tags don't follow XML syntax. Both "<my:key>" and "<my:/iterate>" are not well formed XML (it should be "<my:key/>" and "</my:iterate>"). ====

    They could follow XML syntax, if the example writer (me) would have written the end slash on place. What comes to
    <my:/iterate> the source file DO say </my:iterate> but the
    template pretty printer (anvil.system.formatTemplate()) decides to show that slash in wrong place, an obvious bug.


    ====
    2) The value for the "expr" attribute uses method call syntax, which is not desirable in web page code (which is why I don't use any kind of scriplet in JSP pages). It should be written as "expr=${anvil.system.systemProperties}" (in JSTL syntax, and also in the future JSP 2.0 standard), or something similar.
    ====

    actually it follow "whatever-expression" syntax, although
    i agree that ${...} would be good to have around as well (not possible with custom tags at moment)

    anyways, i find it funny that this discussion seems to to concentrate on taglibs which covers less than 1% on Anvil's code :-)

    i see anvil as a "mini application server" with which you can do just about any web application you ever wanted. sort of "PHP for Java".

    --jkl
  9. Could you put your question this way: "PHP or Java"? I guess it would sound better.

    Max.
  10. Anvil definately was made for solving real-world issues in server-side Java development, specifically for browser-based multichannel apps (HTML/WML/XHTML). The original problem was that Java projects took more time than PHP-based projects. PHP is easier for domain-oriented developers; Java is good for more technical software engineers. Anvil is sort of "PHP for Java", that makes application development on Java platform more productive, and.. more fun :-).

    Since Anvil is "just" a web application language, it does not directly solve those GUI issues. But Anvil is open and free, and anybody can build his dream framework on Anvil. Like Simo Tuokko mentioned in another message, we have built a GUI widget framework on top of Anvil. There is a browser-based visual tool that allows a graphical designer quickly fill a page with advanced GUI elements, and define the event bindings between the elements. The tool was made with Anvil, so it is 100% Java bytecode, and the tool creates more Anvil code, that gets compiled to Java bytecode.

    In my experience I can tell that Anvil makes customer projects more productive. Our customers are happy. (For example, Nokia One, an ASP service for corporations, has been using it for two years, and now they are in production.)

    JPS
  11. What you have described sounds considerably more interesting than the basic Anvil package. The components page is a bit intriguing, but there are no demos.

    Since the Web framework world is so crowded, it really helps to show a prospective user what your framework can do before presenting the details of how it works. Unless I see that it can do something useful for me, I'm not motivated to learn how to use it.

    Anyway, what you have described sounds interesting. Is this part of the Anvil system? Is it proprietary? Is it a separate open-source project? If so, do you have a web site that demos it/shows it off?
  12. A GUI framework for Anvil consists of the Anvil Component API and a visual integration tool, the Anvil Composer. They are the proprietary software of Njet Communications Ltd. We are planning to make the API and sample components freely available. Meanwhile, you might want to browse our commercial Anvil offerings and look at a brief description of the Composer product at
    http://njet.com/index.nvl?c2.select=1&c7.select=3
    If you are interested, please contact Njet Communications Ltd and ask for an evaluation kit.

    JPS
  13. It's a nice framework, but why not just use JSP?

    Everything this frameworks does could be done with a JSP 1.2 tag library, and plain Java Beans.

    I mean,
    * Instead of having a non-standard Java-like server-side
      scripting language, just use the Java language.
    * Instead of a set of non XML compatible custom tags, use
      JSP custom tags, which are compatible with XML and XML
      namespaces.
    * Instead of a proprietary tag library description language,
      use standard JSP 1.2 TLDs.
  14. That's the point. This new "language" doesn't introduce either simplicity or convenience. It simply duplicates the standard features, and acts like an additional layer, consuming server resources. Just my 2c.

    Max.