Sunday, November 16, 2008

Health care insurance

COBRA Insurance
COBRA Insurance (enforced through an act called COBRA) offers temporary insurance (usually 18-36 months max., you can discontinue any time) for people
  1. Who had jobs and had employer-assisted insurance. Through employer's group (other employees where lost jobs) and COBRA provider, they can get insurance.
  2. Who has a job, but employer doesn't pay insurance.
  3. Family members (spouse, children, ...) can be covered.
Coverage:
  1. You can take full coverage you were having before you lost job. For this, you have to 102% of all payments (your premium + premiums paid by your ex-employer + 2% administrative charge).
  2. Or, you can take a lower coverage, resulting lower premium. (I've seen offers like $225/month for a family of four members)

Medicaid & Medicare
Medicare is for mostly for elderly persons. It's a health insurance program by federal government. Pays most of the claims, some copay may be required.

Medicaid is assist program. Can help to pay almost full health care costs. Eligible: pregnant woman or US children or disabled or blind, has low income. You could try even if you don't belong on of the mentioned group.

Proxool 0.9.1

Proxool 0.9.1

Proxool is a JDBC connection-pool provider. Works near-seamlessly with standard way of JDBC. Here is how it works:

Change this
    Class.forName("org.hsqldb.jdbcDriver");
    connection = DriverManager.getConnection("jdbc:hsqldb:test");
to this
    Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");
    connection = DriverManager.getConnection("proxool.example:org.hsqldb.jdbcDriver:jdbc:hsqldb:test");

Thats it.... or, it you want to configure stuff at startup (there are several options), you can do this:
    connection = DriverManager.getConnection("proxool.example");

Not bad... you might find a proper use this someday...

The providers say it's open-source, maintained. I am still not sure who uses it, though.
Blogged with the Flock Browser

Trying OpenJMS, Part 2

In this part, I want to capture my initial knowledge about JMS, not OpenJMS in particular.

The problem JMS solves:
  • Enterprise applications grow at their own will. But, when the point of integration comes, nightmare begins.
  • MOM (see below) allows passing messages (containing information, transaction, etc.) between applications in asynchronous manner.


Characteristics of JMS:
  • Vendor-agnostic Java API for MOM (much like JDBC allows seamless connectivity to different databases)
Description:
  • Message indicates a piece of information, transaction etc.
  • In MOM, there are topics or queues where people share messages. (There is a different between topic and queue; explanation coming.)
  • There are applications called clients who work with specific topics or queues.Those to produce messages are called producers. Those to receives messages are called subscribers. A client can be both producer and consumer at the same time for a topic/queue.
  • For a specific topic/queue, there can be more that one producers, and consumers.
  • When a producer, subscribing to a particular topic/queue, sends a message to JMS,JMS pushes the message to consumer subscribing to that topic/queue. This way the producer and consumer are working asynchronously.
  • JMS Provider (JMS server) can make messages persistent, meaning it ensure that messages are not lost till they are consumed. (Store-and-Forward vs Fire-and-Forget)
  • Topic vs Queue: Topics can have more that one consumer, and each message is sent to all of the consumers. Queues can have more than one consumer, and the contract fulfills when exactly one consumer consumes the message.
  • Usually a subscriber doesn't receive a message if it is not present (i.e. connected) when a message is produced. A subscriber can request to be a durable subscriber (on a topic). If that consumer is not connected when a message is produced, JMS provider will make sure that i sends when that subscriber connects.
    Durability modifies the behavior of subscriber.
  • From the producer side, it can request a particular message to be persistent. When the call from JMS provider returns, it guarantees that the message has be stored on a reliable media (file, or DB, or something else).

The buzz words:
  • MOM - Message Oriented Middleware (a.k.a. Enterprise Messaging System)


Links:
  • Book "Java Messaging Service" by Richard Monson-Haefel & David A. Chappell, from Oreilly - borrowed the book from my colleague Kevin

Saturday, November 15, 2008

Trying OpenJMS

I have become curious to know about processes running in same/different JVM. There are synchronization issues here.

For multi-JVM calls, one of the most common techniques is RMI (Java's implementation of RPC). In RMI, a call to remote machine is blocked. So, your threads are now at the mercy of a different JVM. Enterprise level applications faced this problem long ago. So, they solved the problem by making the call asynchronous. The technical term is Message Queuing (MQ). BTW, enterprise-designers solved on more problem with MQ - connecting legacy applications in a disjointed manner.

For Java, it is called JMS (Java Messaging System), which is a common interface of all major implementation of MQ. The committee for JMS comprised of representatives all major MQ vendors; so JMS essentially covers the common denominator.

OpenJMS is one such implementation of JMS. It came after JMS spec was created. It is open-source. I am using OpenJMS to do my initial R&D on JMS.

My initial comments about OpenJMS are:
  • It is very easy to install. Just unzip.
  • Very easy to run/stop. Run the startup.bat, shutdown.bat.
  • There is a even better way - run the admin.bat. It pops up a small swing-window. From there, you can start/stop OpenJMS instance.
  • Using Admin tool, you can see which topics (a JMS terminology, explanation coming) and queues (another one) are being maintained.
  • Very easy to try to hello-world type thing. Ready to run (you have to have Ant configured, which fortunately I had) sample application can give you scope to do immediate testing.
Q: How do I use JMS in my application?
A: I didn't try this yet. OpenJMS prefers that you get a handle to it (running on same or remote machine) using JNDI (I am also doing some JNDI study; refer to those concepts, I am not going to explain them again here).

I am planning to do some more R&D using OpenJMS with the following setup:
  • Try 2-machine testing using my personal laptop and office-laptop.
  • Try multi-machine testing using VMWare, where I will host 2/3 OS running.
  • Hand-code some JMS client stuff.
I will continue to update this entry.

Links:

Friday, November 14, 2008

Why would you use JNDI?

Basic Stuff
  • JNDI = Jave Naming and Directory Interface.
  • Example of similar services are: DNS, Sun NIS and NIS+, COS (for CORBA), LDAP (decedent from DAP, which ran over X.500) etc.
  • Taking example of DNS, we can locate a server's real location (IP) using its domain name.
  • JNDI enables large java application look up resources (e.g. database location, JMS server location etc.).
JNDI in a stand-alone Java application
  • Let's we have a 2000-class Java application.
  • Think about passing different resoucres to different classes. When you do that, you also have to take care of initializing, managing, scheduling, load balancing etc. issuse.
  • Resources we are talking about can be database connection, logging interface, configurations files, etc.
  • In the bootstrap of the application, we can launch a JNDI instance and plug these necessary resources against different names.
  • Codes, elsewhere in the application, can run a JNDI context to get a handle to JNDI, and then simply loopup objects using pre-agreed names.
  • Now, JNDI has different service providers, enabling access to FS,
JNDI in a stand-alone Java application
  • Now Consider a Java application that doesn't run the JNDI service.
  • No problem, just know where is the JNDI service is running, and then do how you were doing before.
JNDI Service Providers
  • JNDI wants to offers one-stop solution for different lookup services. So, it need service providers to do that. See one of the links for full list of SP (Service Provider).
  • The service providers act as JNDI service.

Examples of JNDI SP are:
  • RMI Registry
  • LDAP
  • NIS
  • File System
  • Windows Registry
  • COS Naming - for CORBA
  • Mirror JNDI - for Object to XML and vice-versa convertion
JNDI Rationale

I've copy/pasted stuff from the links given in the end.
  • As surprising as it may seem, the notion of a card catalog is quite handy in the world of computing, as well. In computing, we call it a naming service, which associates names with the locations of services and with information. It provides computer programs with a single location where they can find the resources they need. In the way, programs don't waste time by performing the electronic equivalent of walking up and down the aisles, and don't require that the locations be hard-coded into their logic, either.

  • Finding resources is of particular importance in large-scale enterprise environments, where the applications you build may depend on services provided by applications written by other groups in other departments. A well-designed naming infrastructure makes such projects possible -- and the lack of one makes them impossible. In fact, many business-process re-engineering efforts begin with the design and implementation of a robust, enterprise-wide naming and directory infrastructure.

Links:

Wednesday, November 05, 2008

So many dozens

While taking an IQ test on Facebook, I bumped into a term called Baker's Dozen. Googling on that revealed some other dozens.

Baker's Dozen
  • During 16th century, bakers in England gave 13 (12+1) items when 12 were asked. There were severe punishment (losing hand) for not giving 12. So they gave 1 extra.
  • In the modern era, the 12+1 rule is followed for different reasons. Assuming 13 items are placed in 3 rows (4+5+4), they can form close-pack hexagon shapes. This makes processing, packing etc. more easy.
  • The concept is used beyond bakery industry.
  • A.k.a. Devil's dozen.
Banker's Dozen
  • It is a pun on the Baker's dozen.
  • Pointing to the ill intentions of the bankers, there are some loan scheme where lender is given the money after deducting the interest in advance.
  • So, the banker gives you less on what is agree upon.
  • Not related to the number 12.
Decimal Dozen
  • It is a dozen of 10 (12 - 2). And it is for a good reason.
  • Invented in Australia around in 1980s.
  • Stats showed that women bought 50%+ of wine.
  • The maximum recommended weight a lady should take was 15kg, which happen to be the minimum weight of 12-pack wine. The weight exceeded up to 20kg sometimes.
  • So, a company came up with the 10 pack solution.
It's all about dozens.. :)

Links:


Blogged with the Flock Browser