Pages

Showing posts with label webservice. Show all posts
Showing posts with label webservice. Show all posts

JiBX - Part 1

When we consider XML as a data model while programming, focus is mostly given on strings/tags/elements in parsing data.The ETL operations are done on this ubiquitous document interchange model when communication is made between applications.To make things simple in the internet; which is fond of documents ; XML became the foundation of services through web.The object, which is accessed from object graphs in the memory have features such as inheritance / polymorphism and attributes / object-based relationships while XML does not have any of these features as objects have.It is merely a grammatical (hierarchical) representation of data with all its branches mangled to itself .But they have similarity in the sense of representation of real world data.Therefore they can exists as the representation of each other which eases in programming.They are effective in defining business uses cases.But there is an impedance mismatch between objects and xmls.An application written in Java, will have it data types defined within the scope while XML Schema which defines the data is richer than Java.Complex objects find difficulty in serializing.Have a look on this paper which explains the X/O impedance mismatch.

We can generate Java classes from XML or vice versa.In this case, it is a "Schema-Centric" approach.We define an XML schema.Then one or more XML documents.Then generate java classes based on them.In this case you need a stable schema which can be used to validate data.Essential for a "reliable" web service.But application code is forced to use an interface that reflects the XML structure which makes them tightly coupled to contracts defined.Any change in schema make a need to regenerate the object model and change application code to match.

If we map the classes using bindings, then its "Java technology-centric " approach.This can be adopted when you don't want object model tied to schema.When there is a need to support different versions of the schema with the same object model or a common data exchange format for existing objects is needed.Binding definitions are themselves XML documents, with a schema defined for it.

JiBX is fundamentally a Java technology-centric (mapped binding) approach uses binding definitions.You define how XML relates to Java objects.Start from schema, code, or both.Binding code is compiled (or wired ?) into files (which uses BCEL byte code enhancements ). It can be done at build time, or on-the-fly at runtime.This makes JiBX compact and fast.JiBX achieves its performance by using post-compilation bytecode manipulation rather than the reflection.The advantage is that there is no need for getters, setters and no-arg constructors.One can write the class without considering mapping issues and then map it without modifications. XML schema describe domain objects.JiBX really maps well to XSD. JiBX is based on a XML pull parser architecture (XPP3) . Rather than generating code from a DTD or Schema, JiBX works with a binding definition that associates user-supplied classes with XML structure. The binding compiler is executed after code is compiled and the marshalling/unmarshalling code is added on to the class files.There are tools along with it, like Bindgen that can generate schema from existing classes.


Tutorials

http://jibx.sourceforge.net/binding/tutorial/binding-start.html
Pdfs - JiBX -Part1 JiBX-Part2 Intro

Previous articles
Creating a Java WebService using Axis 2 (a lazy approach)
A simple RSS parser

A try on iWidget Creation Technology

I tried to build and publish a widget in the iWidgets platform.A data view widget in which my friendfeed will be displayed in it.The UI is similar to other mashup tools like yahoo pipes,Presto wires . It has a customization wizard for the widget, its cool.It supports native widgets.Their WidgetWORA™ technology is patent-pending and it is going to have a wide audience.Peter Yared, Founder & CEO was CTO of Sun Microsystems' Application Server Division.They have a Social Media Accelerator Program with a pay-per-performance pricing as well a free Self-Service form with ads.A good model for monetization.I tried to publish my widget. I couldn't find any link for showing my widget in my blog :( Also these social gadgets can be published to facebook,igoogle,myspace.My iWidget web workspace looked like a desktop tool.


Web 3.0 A case study part -1

While I was with TeamTa , a case study on Web 3.0 was made. It was really a wonderful experience for me as I was able to learn a lot about the emerging technologies. Atleast I came to know that how vast emerging web is the potential of web of entertainment to defense purposes.It is like another universe in which it has its own economy, culture,society,technology etc.. I tried to read as much as I can... yes it was really vast , infinite potential.Many research papers, many articles, many magazines... I know I am good at research.I was able to understand concisely. I am not expert in all these buzzword technologies ... I think one need not be working in high end technologies, but can learn about it and share it or use the idea in some other field.Internet did open human minds around the globe.Anyway I was able to understand and express the way I got it... I decided to open it and share it to world as its an interesting one... so someone somewhere will read it comment about it. As time pass by I will be able to review on the past works I have done.Anyway this blog was made for that purpose.View my case study.

web 3.0 part1
View SlideShare presentation or Upload your own. (tags: web 3.0web)

Creating a Java WebService using Axis 2

The web has become more ubiquitous than it was a decade ago.Years before SOA and webservices were buzzwords.But today they have become the building blocks of enterprise business applications as well as any other web applications.Future i said to be semantic webservices.The web itself is an aplication to application communication.These webservices are those programmatic interfaces available to be used by any application that connect to web.Java clients are efficient to communicate through web.Java web services has shown its impact in industry.I tried to make a documentation on developing a simple Java Webservice using Eclipse WTP tool and Axis 2.You are able to view the document here