Wednesday, June 22, 2011

searches all over the place...

Am working on very enterprisey javaee stack nowadays with ejb3/jpa/hibernate on jboss and all that jazz!! also started reading martin fowler's "Patterns of Enterprise Application Architechture" book and that got me thinking ... I might trampling over all your delicate, squishy layering but this is what i see , i see my Session Beans(SLSB) loaded with finders of all shape and hues and it keeps on growing and a lot of it is to satisfy UI . UI needs to show refer something from someplace , so it needs to query the entity table with a particular combination of parameters/constraints and the tons of codes from the UI through the SLSB and back again with all bells and whistles in between to make it run 1 query.
Will not it be just nice if we could just write a SQL query directly from UI (picture that i am writing and executing a SQL query directly from my extjs code and get response as json). Here anyways UI dictates its needs both in terms of the data columns it needs and criteria on which it needs the query.
  I might be downright stupid to think this way , from the hallowed Domain Model design pattern etc. , that i am going to find out sooner than later but this at the moment makes a lot of empirical sense.
In my earlier workplace i have caught some glimpse of RESTful apis , of how UI independently evolve around a backend that represents a set of Resources and services on them interfaced through json-on-HTTP.
This dilemma could not be new , just that i arrived late and am hunting for the name , can one of you point me to the right direction
Some kind of fluent language in which UI can talk to the backend to ask for data and services but the interaction should not be chunky as we see in standard practice i.e in terms of specific api calls , but rather a grammer based something like SQL, you know what i mean ?