viewing dynamic methods grails

Grails reminds me of those Anton Chekov stories I used to enjoy. A lot of fun, but tough to remember the plethora of characters introduced at different parts of the story, in the case of grails, it is methods added via meta-programming. Each of these methods add an important functionality, but it is tough to guess where the implementation source is and where this method was added.

For example we know every domain class has a list method, but where is it added to the domain class and which class actually backs the list method implementation. If we had information about where it was added in this case HibernateGrailsPlugin, a quick browse through the source would let us know that ListWithFilterMethod is our points of interest.

So I wanted something that for a domain class would give me method listings, with the one for list like


list

public static Object list()
Added by HibernatePluginSupport$_addQueryMethods_closure44

This tells me that list method is added by addQueryMethod of HibernateGrailsPlugin. I can easily find from the source then that ListWithFilterMethod provides the list implementation. The next step is to add a controller and some ui which would help me show such information about any class (Domain, Controller or any other groovy class). The class name could be passed as a request parameter, the ui could be made via jquery so that this fits in as an additional floating div over my existing ui.

Thanks to the simplicity of grails, all this controller has to do is :

  1. Load the class from the parameter name, get its meta data
  2. Iterate through the meta methods, collecting the source from the closure or cached method declaring class and pass it to the ui as json.

The code for doing this could be something like

def metaClass =GrailsUtil.getMetaClass(params.clazzName)
metaClass?.getMethods().each{
    if (it instanceof ClosureStaticMetaMethod) {
       list.add(new MethodInfo(it.name, it.closure.class.simpleName, extractMethodName(it)))
    } else if (it instanceof ClosureMetaMethod) {
       list.add(new MethodInfo(it.name, it.doCall?.cachedMethod?.declaringClass.simpleName, extractMethodName(it)))
    } else {
       list.add(new MethodInfo(it.toString(), null, null))
    }
}
list.sort()
render list as JSON

The end result looks something like

MethodInfo

I call it EGDoc, added it as a floating layer so that it does not come in the way of normal functioning of the application, of course is enabled when the environment is development.

Financial Technology 3.0

Advent of cloud computing, virtualization, mobility and social computing paradigms have enabled newer definitions for the entire financial technology space.FT 3.0 is all about reaching the unreached. It is more about being inclusive and leveraging the un-tapped lower strata of the pyramid which is more dynamic in both consumption and spending.

Existing financial solutions across the BFSI segment are gearing up to be SaaS enabled, Cloud deployable and handset capable solutions. Micro finance systems combined with m-commerce transactions will slowly push banking services to be as dynamic as it can be.

Per Day Banking – A new Disruption

What I visualize will be a day where entire unit of transactions that a consumer does inside the financial ecosystem will be per day. Rapid adoptions of pay per use services will change the revenue streams of financial institutions. M-Wallet transactions will replace the serpentine queues at ATMS (like how ATM’s took over typical visits to Bank). Virtual currencies will move from being inside a social gaming platform to real world usage and applications. Exchange rates will be more centralized, common currencies and centralized trading platforms breaking barriers of economic adoption will erupt.

Service Delivery framework for inclusive financial services

Effective delivery frameworks that encompasses continuous integration of activity streams that arrive out of different technological convergences is very vital for FT3.0 to fully provide all that it can. Compelling return on investments, reduced carbon foot print and more- per single transaction are the key aspects that will define the results that ft3.0 can deliver.

Eg In India, Banking institutions for example are seeing an increased mandate to promote inclusive development and tap into rural, semi urban and untapped market, consumer spaces. Currently available banking solutions and frameworks may not /cannot cater to such a customer base unless they leverage the adoption of new age technologies that constitute FT3.0. A framework that can solve such a problem, catering to billions of people in India, can easily replicate itself successfully for Global markets with required customization.

Shared common Framework for Financial Institutions:

A potentially fool proof framework that needs to be envisaged is a Shared common framework that can leverage the power of cloud computing.

A shared common framework helps large number of banks to take advantage of shared infrastructure and resources, rather than each making its/their own investment. This model offers economies of scale to customers enabling banks to eliminate upfront high capital costs through sharing of application services.

This results in reduction of significant capital outlays as it will lead to a totally new and radical transparent monthly pricing model. Such a solution built on a shared common framework will catalyze efficiency in operations, provide greater compliance and risk management, enhance customer satisfaction and integrate more banks and financial institutions into main stream banking and financial activity.

Conclusion :

FT3.0 is the way forward. It will certainly be beyond boundaries. It will certainly be disruptive. Imaginea is at the fore front of this innovation.  Partner with us and stay ahead.

My other Blogs relevant to the topic:

http://blog.imaginea.com/financial-industries-and-cloud-services-trends-and-innovations/

http://blog.imaginea.com/new-age-banking-is-all-about-being-social-and-cloud-enabled/

HTML5 - World Wide Web Revolution

Chorme and Droids opening up the floodgate of amazing possibilities that will capture the imagination of the Netizens !

Welcome to a new World free from ‘Desktop Vendor Lock-In’ and ‘Internet Monopoly’ !

A new Revolution had begun when Web started being treated as Platform by Facebook, Zoho , Netflix, Google, LinkedIn, SaleForce, Tumblr, Jigsaw and many more who joined the forces in recent time !

Internet at a growth rate of 120% .. has definitely outperformed and outpaced other networking mediums - tv/radio/magazine/newspaper.

And now today Browsers empowered with HTML5 are helping Web apps become as powerful as Desktop applications !

Essentially its a giant leap forward by Google and like-minded benedictors towards the efforts of creating powerful Browsers to free the Earth from the bondage of Desktop OS !

Thanks to HTML5 Server Sent messages for performing this magic of representing Rich Media / High-Perfornace Graphics / Desktop Content / Complex Netwroking / Offline storage etc.

HTML5 - Web GL is the technology behind rendering GPS on mobile and computer browsers.

HTML5- Workers allow web apps to access and leverage the power of multi-core CPUs boosting the Rich-UI experience to a great extent.

As per the Google Prediction, by the end of 2010, the HTML 5 features like - Web Video / Canvas / SVG / AppCache / Web Storage / Web Sockets / Geo Locations .. will be supported by all major browsers (Opera, Chrome, Safary, FireFox) .. except … guess what !.. Yes .. IE .. which will support only Video / SVG and Web Storage falling behind all other 4 browsers !!

So there will be a surge in start-ups and new initiatives for developing innovative products on these open standrds !

Say, DarkRoom (from MugTug) allows editing photos and applying amzing affects Online .. and pretty fast ! It makes best of ‘AppCache’ for creating GUI on Web. Even browsers will support creating GUI using local storage in offline mode and then simply synching up once user goes online.

So no need to install a ‘Photo Editor’ on desktop, then download photos locally, apply effect and upload on web and sync back n forth !! Great Huh !

Gmail and many other mail clients had adopted the HTML 5 File API and Notification API for Drag-n-Drop of any attachment on the mail.

The beauty is - if the proper chrome extension is installed, then while surfing net, users will automcatically get notifcation about gmails even without leaving current page and without starting local mail client!

Clicker.TV is a great implementor of ‘Worker‘ for pulling a huge amount of TV and Media live streaming and then caching. Its a huge leap forward !

Open Video Codec (VP8) offering super quality video streaming through Chrome and Youtube by taking advanges of multiple cores and open standrds of DSP.

Google TV will certainly revolutinize the concpet of ‘Telecast over Net’

How about Animation using CSS and Javascript using html5.

Tooling around CSS and fast network roundtrips (all HTML5 blessings) will open up new possibilities in the Multi-player Online Gaming World !

Imagine running any 3d Game written using native Client into the browser !

Mashing Up service and online apps will also become easier.

TwitDeck is a great example.

Here one can move the twit widgets and instanly comes to know from where ‘certain apps’ are coming from. Twit notifications are constantly monitord and pushed from server and corresponding Geo Locations are queried upon to present all the relevant information to the users.

The big question is once a Magazine is actually represneted as a Magazine in a browser and not as a mere Webpage , then do we really need to invest in iPad or Kindle !

Thats the power of openness !

Thats what Chrome is about to do .. just stay tuned to Google Technologies …. its going to Recrate the same Immersive Experience that you enjoy while reading a newspaper or magazine !

Imagine how dramatically it will increase the reachability of popular media brands and skyrocket its revenue !

HTML 5 will simply metamorphose business models !

Now there is great gift from Google for the Apps Developers !

Using HTML 5 google provides Infrastructure as Services on demand and Virtualize existing complex apps through its collaboration with VMWare Cloud and SpringSource.

Few commands in Spring Roo Shell will – create a Spring Project, do the Persistence Setup, Create Entities, Services, provide GWT artifacts, package, update GWT .. in couple of minutes (for a small demo app) and Google App Engine Plugins (assuming user installed SpringSource tool Suite) upload the app in cloud .. also immediately use Spring Insights and Cloud Monitors to provide performance stats !

Lets all enjoy the freedom of choice and openness offered by HTML5.

Reference : HTML5 Google IO , Chrome OS