Abstract Classes Vs Interfaces

Say, we are trying to implement a new behavior 'whistle', to a group of unrelated things.
For e.g.) Assume we are trying to add whistling behavior to parrots, humans, aliens, cookers and a steam engine. Do you find a relationship between these objects? Do these have a is-a or has-a relationship?

 The juice is when we have a group of unrelated objects and you have to define a common behavior between them, Interfaces is the answer. Of course I can write a whistle abstract class and have parrots and humans extend it. The problem is still solved. But does it make sense when Humans and Parrots extend the whistle class just for the sake of implementation?

Imagine you are sitting in a closed room and you hear a whistle sound. At this point, you are not sure who whistles. IT could be parrot or an alien or a human or a cooker. This is another use of interfaces, At run time when you don't know the type of object, it is easier to use an interface and access the behaviors in the object.

I think by now, it is clear to decide between Interfaces and Abstract Classes.


Jquery fundas

This week was all about Jquery...!

Though I've been using it in bits and pieces, did not get a chance to do something so exhaustive in jquery till now. 

So here are few things, which I learned this week..I'll keep updating this post every now and then..


Designing and Developing Interoperable Services

  • SOAP is a simple XML-based protocol to let applications exchange information over HTTP.
  • Specification for exchanging structured information in the implementation of Web Services in computer networks.
  • Why SOAP?
    ·        SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
    ·        HTTP is supported by all Internet browsers and servers.
    ·        Because of the verbose XML format, SOAP can be considerably slower than competing middleware technologies such as CORBA.

    Tools used to implement SOAP:
    Apache Axis/ JAX WS/ JAXB

Ignorance makes you more ignorant!

I was working on a personal project for creating an online post-it like application using Jquery, JSF and google Apps..

The idea was to have a text area where user can type and notes will be saved automatically through ajax calls..

Then I thought to add the draggable feature to make it look better, with little effort made I it work to only learn that the draggable feature will not  work on the dynamically created DIVs. Googled a lot and found a work around and made it work..

The previous issue was fixed to land on this new one -  Draggable did not work on text area!  I added borders to DIV so that the user knows where to drag (I know it's crappy!)

After making that work, I thought an in place editor will make the app look better i.e, the text area will be enabled only when it is focussed, other wise it will be disabled…Am no expert in Jquery, all that I saw did not reach me…I was totally frustrated and was in need of a break very badly...

With some hopes, came back and googled to see this HTML 5 attribute contentEditable (http://html5demos.com/contenteditable/) ..sweet, all my issues vanished in no time.
A DIV can be edited directly in HTML5!

1. Ignorance makes you more ignorant :(
2. Googling will help you overcome your ignorance :)

Tired of seeing that 500 Bad gateway error while deploying a Springboot application in AWS...?

By default, Spring Boot applications will listen on port 8080. Elastic Beanstalk assumes that the application will listen on port 5000. Th...