Wednesday, March 31, 2010

Debate over Domain Agnostic Connections

I recently introduced after a proof of concept and technology Service Integration Bus to enable Event Driven Architecture style integration across the commercial enterprise.

The first team implemented it exactly as the POC specified. The second team that was responsible to be the durable subscriber raised concerns about Domain Agnostic Connection factories.

The claim was that using domain Specific Connection Factories makes life easier. The basic difference between the two is that one uses for example TopicConnectionFactory to create a TopicConnection, whereas the domain independent connection factory lets you look up a ConnectionFactory to create either a TopicConnection or a QueueConnection. This lets you get flexibility in the app and is basically a new feature in JMS specs.

Anyway the second team was up in arms about using domain agnostic connection factories. “Why is architecture recommending this? It’s making life difficult for us!”. Of course the first thing you learn in software architecture school is :make life hard for the development community. The tone and attitude changed at the end of this debate – architecture was a friend and developers happily followed the direction. How ? Surprised me. This blog entry is probably a note to myself.

How do you convince developers to do the right thing, ‘change’ and adopt a new way of doing things? Sift through words and select the right bytes. Software architects must recognize ‘code’ in spoken language. Understanding the subtle hints and uncovering the real issues. This is the key. Sounds like management skills? Yep, a little bit.

This is not science and they don’t teach you this in college. Negotiation and arguments must be approached uniquely each time based on context. When this ‘senior’ software dev was lamenting about how hard his life is going to get because architecture decided – he was starting getting an audience that did not understand the topic. He kept saying that we should not use Domain Agnostic Connection factories, I needed to break it down quickly and stop the nonsense. Usually when there is resistance to change, it is mostly because this new change has not really sunk in mentally. Addressing concerns objectively is the first step.  Use technical facts, lay it down straight. This needs to be the corner stop of every architect and a must-have skill. If you don’t know why you’re recommending something, just don’t. If you do -  SEI’s ATEC skills comes in pretty handy here.

In this particular case, the facts were that the recommendation had clear advantages. However, this did not seem to satisfy the senior developer. After some social digging it turns out that the fact that the architectural decision to use Domain Agnostic Connection Factories was made without the sr developer in question being involved was a contributing factor to the resistance. This little tit-bit of information was gathered from his peer. I opined that this was the key to his constant lamenting. With this hypothesis I formulated the next steps. Now, one has to be careful because this is the type of situation when people start looking backward and not forward. Even in hindsight, it was not possible to predict this engineer’s interest in the topic. It was explained that these decisions were made along with a host of other decisions through a Proof Of Concept and technology evaluation. This was reviewed and approved by other senior stakeholders. It was documented on the wiki and the link was sent via email. I worked with the technical person senior to him in his team – and explained the matter in technical terms. He heard from him and me, saw that others were on the same page too. A few more emails with links to document and an encouraging note – things started to look better. The attention he received probably made him realize that it wasn’t a purposeful exclusion on that decision but the natural process of technology selection by a whole host of senior technologists. The technical reason for using domain agnostic connection factories is sound and makes sense for advanced JMS systems that don’t want to have 2 connection factories depending on what messaging resource they are connecting to.

He replied back saying that he would follow this direction. It turns out that the direction was finally adopted. So what is the moral of the story ? Sometimes it matters how you make others feel about technology regardless of what the technology does for them.

Wednesday, February 24, 2010

Are DSLs simply XML Hell?

DSL : what is it ? You have used a Domain Specific Language. Trust me. Demystify DSL: it simply a narrowed and specific semantic problem that solves a narrow set of problems.

Model-View-Controller (MVC) is a common pattern for Web development, Apache Struts has come to the rescue in the past. Each Struts application uses a configuration file (XML). The language (dialect) of the XML specifies exactly how the MVC pattern would be implemented for the specific implementation this is DSL.

Object Relational mapping was a common problem made worse by general purpose languages and APIs(e.g. Java and JDBC), along came the a natural ORM (e.g. Hibernate) with specific configuration files that mapped POJOs to Tables. The configuration file (XML) supported a dialect (ORM DSL), of course it was not called DSL back then they were simply configuration files (aka XML Hell).

DSLs don’t necessarily mean XML. For example, running rules in Java was ‘simplified’ by a Rules Engine implementation e.g. Jess. This used a DSL - Jess 7 has its own declarative XML rule language called "JessML" (a DSL).

What is the advice for people who are trying to learn DSLs and master them ? Don’t. Try not to master DSLs instead focus on the domain of the problem, understand the software architecture and how it fits, understand what the pattern of problems are, figure out how best to apply design patterns that solve them. Understand the pain of the domain (e.g. web-site design, object-relational mapping framework, rules etc), understand the inefficiencies, then focus on an over all design within the domain that solves most of the problems. Finally, look at the DSL as a tool to solve the problems in a specific efficient way. Then you will see there is no XML but simply a graceful solution.

Sunday, January 17, 2010

EJB 3.1 (Asynchronous Beans)

Enterprise Java Beans specifications have finally matured to a point where it may actually help with performance: container-managed Asynchronous beans.
speed
You can now specify a Session Bean (and/or a method) to be asynchronous. End-user perceived wait times can be significantly reduced with an asynchronous programming model that doesn’t force the complexity of AJAX, MoM or application-managed server threads.
With EJB 3.1 when you call the method from your client, the container will take the request and return immediately. Then it will dispatch the request to a bean instance within the pool of SLSBs.
The return type for async methods is either void or Future. The Future interface provides methods to check whether the operation has completed, gets the result – with options for a timeout and also cancel the operation. A concrete implementation of Future is AsyncResult which is available in the javax.ejb package.
Stateless EJBs may choose to return the AsyncResult object with any type returned. Transaction propagation is simple &  limited - REQUIRED=REQUIRES_NEW attributes. If your client is already in a transaction, or your beans are in a transaction, the async method is called in a totally new transaction with no propagation (as in synchronous methods). This makes a lot of sense, because the entire purpose of asynchronous calls are to decouple a process orchestration to speed up things. However, it does complicate compensation and atomicity. Software architects need to trade-off between transaction demarcation and generally ACID properties across various calls. Any application exception that gets thrown by the bean for a void return type cannot be handled by the client. If your bean can encounter an exception and your client cares about handling it, then return a Future<V> form the bean. The client must handle the exception on a Future.get and getCause from ExecutionException.
An entire bean (itself or via it’s super class) can be marked as @Asynchronous. Sometimes it makes sense to expose the same business function as a synchronous and an asynchronous interface, using the @Asynchronous tag can provide the cohesion with a decoupled interaction model. This opens the door to multiple use-cases that need a simple way to conduct asynchronous calls without the complexity of MDBs or managing application owned threads. EJB 3.1 has built upon the POJO model for EJBs with an excellent way to realize asynchronous server-side models.

Saturday, January 2, 2010

Google Chrome @ 5% (almost)

Google Chrome is now the 3rd most popular browser in the world.

According to recent reports here and here, Google's Chrome has overtaken Apple's Safari in the browser wars. While still at less than 5% chrome is no match for Microsoft's Internet Explorer which is slightly above 62%. Chrome is gaining strength quickly mostly due to two quality attributes: speed and reliability. Chrome is noticeably faster than Opera, IE, Firefox and Safari. It's reliability is unsurpassed due to its multi-process architecture.


Coming in at #3 just months after it's GA release is commendable. With new features like bookmark sync and support for themes and plug-ins it will rival the # 2 spot in a couple years, eating away Microsoft's and Mozilla's share.

Tuesday, December 8, 2009

SSH and Strawberry Perl

Strawberry Perl doesn't come with SSH modules pre-installed.

Here is how to insall

C:\>perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.9304)
ReadLine support enabled

cpan> install Net::SSH
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (connect: timeout)]

As a last ressort we now switch to the external ftp command 'C:\WINDOWS\system32\ftp.EXE'
to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp3104'.

Doing so often leads to problems that are hard to diagnose.

If you're victim of such problems, please consider unsetting the ftp
config variable with

o conf ftp ""
o conf commit

I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':

http://www.perl.org/CPAN/
ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes] yes
Fetching with LWP:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: timeout)]
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (connect: timeout)]
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (connect: timeout)]
Fetching with LWP:
http://www.perl.org/CPAN/modules/02packages.details.txt.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: timeout)]
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (connect: timeout)]
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (connect: timeout)]
Fetching with LWP:
http://www.perl.org/CPAN/modules/03modlist.data.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: timeout)]
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
Creating database file ...

Gathering information from index files ...
Populating database tables ...
Done!
Running install for module 'Net::SSH'
Running make for I/IV/IVAN/Net-SSH-0.09.tar.gz
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/I/IV/IVAN/Net-SSH-0.09.tar.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (connect: timeout)]
Fetching with LWP:
http://www.cpan.org/authors/id/I/IV/IVAN/Net-SSH-0.09.tar.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (connect: timeout)]
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/I/IV/IVAN/Net-SSH-0.09.tar.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: timeout)]
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/Net-SSH-0.09.tar.gz
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/CHECKSUMS
Checksum for C:\strawberry\cpan\sources\authors\id\I\IV\IVAN\Net-SSH-0.09.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
DONE

CPAN.pm: Going to build I/IV/IVAN/Net-SSH-0.09.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Net::SSH
cp SSH.pm blib\lib\Net\SSH.pm
IVAN/Net-SSH-0.09.tar.gz
C:\strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl
1..1
ok 1
IVAN/Net-SSH-0.09.tar.gz
C:\strawberry\c\bin\dmake.EXE test -- OK
Running make install
Prepending C:\strawberry\cpan\build\Net-SSH-0.09-cQfbZo/blib/arch C:\strawberry\cpan\build\Net-SSH-0
.09-cQfbZo/blib/lib to PERL5LIB for 'install'
Installing C:\strawberry\perl\site\lib\Net\SSH.pm
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
IVAN/Net-SSH-0.09.tar.gz
C:\strawberry\c\bin\dmake.EXE install UNINST=1 -- OK

cpan>

ADSL on Ubuntu 9.10 (Karmic Koala)





Working with ADSL modems on Ubuntu 9.10:


Configure: pppoeconf
sudo pppoeconf
Check: rohit@lenovo:/etc/network$ more interfaces auto lo iface lo inet loopback iface dsl-provider inet ppp pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf provider dsl-provider auto eth0 iface eth0 inet manual
Start: pon

rohit@lenovo:/etc/network$ sudo pon dsl-provider
Plugin rp-pppoe.so loaded. RP-PPPoE plugin version 3.8p compiled against pppd 2.4.5
Stop:poff
sudo poff
Log:plog

rohit@lenovo:/etc/network$ plog Dec 8 16:37:45 lenovo pppd[11102]: Plugin rp-pppoe.so loaded. Dec 8 16:37:45 lenovo pppd[11102]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.5

This method works well for BSNL's ADSL lines in Kolkata.

Sunday, January 11, 2009

Download HD Trailers from Apple Trailers

Apple movies now 'stream' mov files, they cannot be saved (like they us. for example, if you view the HD movie trailer for the movie "GOOD" - the URL on the page leads to this stream:
http://movies.apple.com/movies/ifc_films/good/good_1080p.mov
Saving link creates a mov file of 75k - not the movie.

In order to download, add the letter 'h' (Hidden) to the movie file name:

wget http://movies.apple.com/movies/ifc_films/good/good_h1080p.mov

HD-Trailers.net has an article on this and a tip for Yahoo HD Movie Trailers - which I've never used...

Tuesday, December 23, 2008

The Green Way to Fax (paper-less)

If you are like me and work with PDFs a lot, often times you get PDFs that you may need to PRINT and sign, then fax - because they can't accept e-mails etc.

PRINTing and Faxing wastes Paper on both sides. 

There are many FOSS tools in Linux that allow you to edit PDFs, insert Text and images.

  1. Use PDF Editor to open a PDF document, and open it for editing 
  2. You can insert text and/or images (like a scanned ink signature)
  3. Once done, simply save it as a PDF, or JPG image.
  4. Now you have an electronic document filled out and 'physically signed' to be faxed away

PDF Editor provides a very good interface to open a PDF and edit it in multiple ways, repackage and save it as a PDF.

Go to Ubuntu Software Center and search for 'PDFEditor'

Related articles:

Saturday, November 29, 2008

Initialize Interpid Ibex

Well well - I decided to remove Vista from the Vostro, downgraded to XP and dual-booted with Ubuntu 8.10

Installation was smooth as ever and grub worked perfectly. Dell ships with these broadcom network adapters that need b43 drivers - thankfully these are provided with the new dist.

There is a bunch of software that I typically need/want/desire - here are the steps to get it

I don't mind free closed-source software, so edit /etc/apt/sources.list & enable what's disabled.

Enable medibuntu:

sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list -O /etc/apt/sources.list.d/medibuntu.list

sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update


Now go for the mass install - remember Google & Sun want you to agree with their license terms - so keep an eye out for those when the time comes tab to Ok and hit enter.

sudo apt-get install python python-central python-gtk2 python-compizconfig compizconfig-settings-manager amarok flashplugin-nonfree amule audacity azureus banshee bluefish dvdrip filezilla msttcorefonts gnucash gstreamer* gtkpod-aac sun-java6-bin sun-java6-javadb sun-java6-jdk sun-java6-jre sun-java6-plugin k3b kino mplayer mozilla-mplayer quanta kompozer scribus xchat-gnome bittornado bittornado-gui sound-juicer helix-player mozilla-helix-player googleearth acroread mozilla-acroread non-free-codecs ubuntu-restricted-extras libdvdcss2 opera xine-ui xine-plugin xmms2 xmms2tray xmms2-plugin-airplay xmms2-plugin-alsa xmms2-plugin-ao xmms2-plugin-asf xmms2-plugin-asx xmms2-plugin-avcodec xmms2-plugin-cdda xmms2-plugin-cue xmms2-plugin-curl xmms2-plugin-daap xmms2-plugin-faad xmms2-plugin-flac xmms2-plugin-gme xmms2-plugin-gvfs xmms2-plugin-ices xmms2-plugin-icymetaint xmms2-plugin-id3v2 xmms2-plugin-jack xmms2-plugin-karaoke xmms2-plugin-lastfm xmms2-plugin-m3u xmms2-plugin-mad xmms2-plugin-mms xmms2-plugin-modplug xmms2-plugin-mp4 xmms2-plugin-musepack xmms2-plugin-normalize xmms2-plugin-ofa xmms2-plugin-oss xmms2-plugin-pls xmms2-plugin-pulse xmms2-plugin-rss xmms2-plugin-sid xmms2-plugin-smb xmms2-plugin-speex xmms2-plugin-vocoder xmms2-plugin-vorbis xmms2-plugin-wma xmms2-plugin-xml xmms2-plugin-xspf vlc vlc-data vlc-dbg vlc-nox vlc-plugin-arts vlc-plugin-esd vlc-plugin-ggi vlc-plugin-jack vlc-plugin-pulse vlc-plugin-sdl vlc-plugin-svgalib thunderbird skype


Note: When you run Google Earth ensure that you have not Desktop Effects enabled.

This should provide nearly all the functionality that's needed for a baseline O/S installation.

Sunday, July 20, 2008

Recover Dual Boot XP, Ubuntu 8.04 (Hardy Heron)

Issue: I needed to reinstall Windows XP on a dual-boot machine. No new partitions were needed, there were 2 O/S partitions - one with XP and the other with Ubuntu. After reinstalling Windows - the machine would simply boot into Windows XP (no dual-boot menu)

Solution: Boot from Ubuntu LiveCD - choose to demo. Then open terminal.


rohit@rs-dimension:~$ sudo -i
[sudo] password for rohit:
root@rs-dimension:~# grub

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub> find /boot/grub/stage1
(hd0,4)

grub> root (hd0,4)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,4)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.



This setup grub in hd0 on my system - bringing back the boot menu. Simple

The Human-AI Partnership: Why Mastering Touch Typing is Your Next Generative AI Superpower

Generative AI requires humans to establish thought partnership rather than allow AI to take over critical thinking skills. I believe that ty...