Sunday, September 11, 2011

Ext.ux.form.field.InputRadio - specify radio input value at Runtime

Here's form widget i thought could be useful, it is a subclass of standard extjs4 radio class with the extension that it has a inputbox next to the label where the user can type the value that is to be its submit value and thus it disregards the 'inputValue' config supplied for standard radio button. Thus can be used in a  radiogroup along with normal radio buttons(static values) to have an option of a dynamic(user entered) value as a possible value.

This is a very rough first cut and work in progress and i intend to put it on GitHub shortly , till the js file and an example html can be obtained here , please  put both the files within your extjs4 directory and run. Comments, views , improvements are greatly welcome. Let me know if this is useful to anyone and in what scenarios has this been used.
Update 03/12/2011 - Have hosted the project in Github here, with some enhancements, like support for binding of data loaded to a form through setValues or loadRecord functions. Suggestions, forks most welcome.

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 ?

Saturday, January 8, 2011

is this code Clean ? or is it my mind .....

I just completed reading chapter 15 of the famous CleanCode book by @unclebobmartin but  there is something that makes me feel uneasy.

    The chapter was illustrating the process of refactoring an existing class from the junit framework , the final draft was really inspiring and beautiful. But my problem is the way that class is designed on a whole , to draw a simple comparison , consider a class for adding 2 numbers , let us call Adder such that 1> Adder myAdder = new Adder(3,2); 2> int sum = myAdder.add();  
    Please excuse me if the above example looks too naive but the point i am trying to make here is why should i write a stateful class which is immutable anyways and utility is to expose behaviour for which it acts only on its initialized state .  
    The only justification for such construction are the standard type wrappers e.g String, Integer al. But to write a such a class with the intention of using it as a general utility doesn't make sense to me or am i missing something here, please share ur thhoughts on this.  
    This particular construct is very recurrent in the examples of that book and makes me curious at its apparent incongruence with everything that book stands for and hence i think  should discover the logic