[Home] [Technology Journal] [Repository]  [Cooking] [Event Calendar]
Technology journal - Interview Primer

JMS Concepts | J2EE Architecture | Java - Concepts | Open Source | Web Service Concepts | SOA | Finance concepts | Rule Engine Concepts
JMS Concepts
JMS is an API that allows applications to create, send and receive messages

Two main properties of JMS:
  • Asynchronous: A JMS Provider can deliver the message once a client is available
  • Reliable: Ensures delivery once and only once
JMS Provider:
It is the messaging system that implements the JMS interfaces and provides administrative and control features

Point to Point Messaging:
When to use: Use PTP when every message you send must be processed successfully by one consumer.

Steps:
  1. Message is sent to a Queue
  2. Receiver picks up the message
  3. Message is retained until it is picked up by JMS Client

Publish / Subscribe:
When to use: Use Pub / Sub when there are multiple consumers for the same message

Steps:
  1. Message is sent to a Topic
  2. Subscribers of that Topic are notified
  3. Subscribers pick up Message from Topic
Note: Publishers and Subscribers are generally anonymous

ConnectionFactory:
Client uses the ConnectionFactory to create the connection with the provider (e.g. QueueConnectionFactory / TopicConnectionFactory)

Session:
  • The Session object is used to create the Queue Sender and Queue Receiver
  • The Session object can be used to create an asynchronous message listener
  • The Session object can be used to commit or roll back the transaction
Sample code:
queueConnection.createQueueSession([boolean to indicate transacted session],[integer to indicate Acknowledgement Mode])
  • Transacted Session values
    • Transacted Session on: True
    • Transacted Session off: False
  • Acknowledgement modes:
    • AUTO_ACKNOWLEDGE
    • CLIENT ...
    • PUB_SUB ...

Durable subscription:
The Durable subscriber program shows how durable subscriptions work. It demonstrates that a durable subscription is active even when the subscriber is not active.

Destination:
Refers to the location where a message is created
Refers to the location where a message is to be sent


Message Driven Beans (MDB):
The MDB allows J2EE applications process JMS messages asynchronously. Session and Entity Beans allow you to send messages synchronously.
The EJB Container - notes:
  • Creates the message consumer (QueueReceiver or TopicSubscriber)
  • At deployment time the MDB is associated with a destination and to type of subscription (these entries are made in the Deployment Descriptor
  • No need to call setMessageListener
  • Implement the class javax.ejb.MessageDrivenBean
Steps to use MDBs:
  • Create the Message Consumer
  • Register the Message Listener
  • Specify the Message Acknowledgement Mode
Java Concepts
Multiple Inheritance:
Java does allow for multiple inheritance. One may extend a SuperClass and implement multiple interfaces. However, it is not the concrete multiple inheritance as available in C++. In Java concrete multiple inheritance can be achieved by Composition & Delegation

Example implementation:

interface A() {
 public void aMethod();
}

interface B() {
 public void bMethod();
}


class AHelper implements A {
 public void aMethod() {
  // some implementation
 }
}

class BHelper implements B {
 public void bMethod() {
  // some implementation
 }
}


class Alphabet implements A, B {
 public void a() {
  AHelper aobj = new AHelper();
  aobj.a(); // Delegation
 }

 public void b() {
  BHelper bobj = new BHelper();
  bobj.b(); // Delegation
 }
}


Advantages of this approach:
  • Achieve multiple inheritance
  • Flexibility of changing the implementation of aMethod() and bMethod() in one place
Web Service Concepts
WSDL: Web Service Definition Language
It is an independent communication protocol or data format. It supports the following protocols:

Protocol Synchronity Data Format Description
HTTP Sync & Async GetPost, XML & SOAP Unsecure, platform independent, remote
HTTPS Sync & Async GetPost, XML & SOAP Secure, platform independent, remote
JMS Async XML, java objects & SOAP Peer to peer communication & Publish / Subscribe
SMTP Async Context based, XML, & SOAP Remote ...
CORBA Sync Corba Object Direct remote object invocation
Finance Concepts
Option:
The right buy not the obligation to buy (call option) or sell (put option) a specific amount of a given stock / commodity / index at a specified price (strike price) during a specified period of time.

Prime Broker:
Acts as a settlement agent, provides financing for leverage, custody of assets for money managers, hedge funds, professional investors, etc.

Broker / Dealer:
Any individual or firm in the business of buying and selling securities for itselt and others. B/Ds must register with the SEC.
Broker, executes orders on behalf of his client
Dealer, executes trades on behalf of his firm

Financial Leverage:
The degree to which an investor is utilizing borrowed money.

Asset Class:
Type of investment - stocks, bonds, real estate or cash

Derivative:
A financial instrument whose characteristics and value depend on an underlying bond, equity, currency or commodity. Examples are Futures and Options
Future: A contract for delivery of product at a price on a future date
Option: No obligation to buy the financial instrument
Rule Engine Concepts
Different types of rules:
  • Declarative rules: set of rules that compute values or enforce constraints
  • Decision tree rules: rules that use forward chaining to make a decision
  • Process rules: rules to manage the receiving, assignment, routing and tracking of work
Forward chaining:
Forward chaining is defined as a data driven technique used in constructing goals or reaching inferences derived from a set of facts, example implementation: JESS - Java Expert System Shell (http://herzberg.ca.sandia.gov/)

Backward chaining:
Backward chaining starts with the desired goal and then attempts to find evidence to prove that goal

Current Rule Engine framework can be defined in 4 layers:
1st Layer: Operating System
2nd Layer: Database
3rd Layer: Rules
4th Layer: Applications

[Home] [Technology Journal] [Repository]  [Cooking] [Event Calendar]