#1657 Tales Web Framework 0.5

kaushik Wed 28 Sep 2011

Two of the loudest requests for tales are addressed with this release

  • Docs
  • Ability to write Javascript in Fantom

Though no amount of docs is actually enough, I've at least made enough docs to "get going"

Also tales 0.5 has full integration with fanquery and fanbatis.

So why should you use tales? Here are a few reasons:

  • True auto hot reloading-Tales has true auto hot reloading.The VM is never restarted. Tales makes a distinction between implementation and interface code. Any changes to implementation code reloads in milliseconds. An api change reloads within a second or two. In any case, page , session and cache information are intact. All you have to do is hit the refresh button on your browser
  • Write javascript in fantom. Yet use jquery- Example
    Jq("#button").slideUp.slideDown(["duration":Jq.slow])
    Jq("#link").click|event, cur|{
       Win.cur.alert("Ouch!")
    }
    Jq("#myphoto").fancybox
  • Easy easy ajax - Almost every java framework out there supports some kind of easy ajax, but imagine how simple we can be since we are doing both client and server in fantom. Check this
    userService->login(username, password)|Bool result|{
      Win.cur.alert(result?"Login Successful":"Wrong username or password")
    }

That's an ajax call.

  • Easy ORM with Fanbatis - A mybatis wrapper that provides simple abstractions for crud operations but lets your write sql when you want it. For eg.,
    User user := Db.one(User{it.id = 1})

or..

class UserSqlMap : SqlMap{
    @Select
    User getUser(Int id){
       one(sql<| 
		 select u.userid, u.name 
		 	from User u,Company c 
		 	where u.id = #{id} and 
		 	u.companid  = c.id and
		 	c.isdeleted = 0
       |>
    }
} 
  • Html stays html templating - Tales templates are just html without any logic. They can be previewed and designed outside of tales.
  • Js, Page, Session and Cache level storage, Yet horizontal scaling - Apart from Js level storage, tales allows you to store information per Page, per session or in cache. The hangman game in "tales examples" demonstrates page level storage
  • A lot more..
    1. When an error occurs, tales shows you the source code and the exact line containing the problem right inside the browser
    2. Create and send dynamic emails with same ease as regular pages
    3. Simple Dependency injection(even for Javascript)
    4. REST support
    5. "Cut and send" html allows you to cut a portion of html and send it to javascript where you can do a Jq.append("") instead of reconstructing html in the javascript. Great for Lazy loading of page data and inserting new html on the fly
    6. Support for rendering html, xml, text and other file formats
    7. Production mode builds a pod which is Front-server(ngnix and apache) friendly. For eg., when building your pod all static data are copied to a folder. You can easily instruct ngnix or apache to deliver these from this folder instead of loading your tales server with these data
    8. Fun and more productive Fantom with little easter eggs here and there :)

DanielFath Wed 28 Sep 2011

Wow... that's quite a lot of features. Great job!

That reminds me I have something to ask of you.

kaushik Wed 28 Sep 2011

Thanks Daniel.

That reminds me I have something to ask of you.

yes? You can mail me if you want too :)

DanielFath Sat 1 Oct 2011

Kaushik I've been looking at the source. Could you show me where did you create that DSL (i.e. sql<|) and/or SqlMap?

Login or Signup to reply.