jump to navigation

SDLC Models January 28, 2008

Posted by Coolguy in Software Development.
  • Agile: Iterations. Has planning, analysis, development, etc. Timeboxed
  • RAD:  Prototyping
  • Waterfall: Sequential
  • XP: Agile method for rapid development
  • Scrum : Project management for Agile
  • Iterative: Incremental development.

EJB 2.0 vs 3.0 January 25, 2008

Posted by Coolguy in J2EE, Java.
add a comment
  • Entity beans retire.  Come Java persistence API
  • Deployment descriptors retire. Come annotations
  • JNDI lookups are no longer necessary
  • Simple POJO components
  • Less classes and interfaces

EJB Lifecycle January 25, 2008

Posted by Coolguy in J2EE, Java.
add a comment

Stateful Session bean:

  • setSessionContext
  • Client calls create. Container calls ejbCreate
  • ejbPassivate
  • ejbActivate
  • Client calls remove. Container calls ejbRemove

Stateless Session bean:

  • ejbCreate
  • setSessionContext
  •  <<Invoke business methods>>
  • Container calls ejbRemove

Entity beans:

  • setEntityContext
  • ejbCreate
  • ejbPostCreate
  • ejbActivate
  • ejbPassivate
  • ejbRemove
  • unsetEntityContext

Message Driven beans:

  • setMessageDrivenContext
  • ejbCreate
  • ejbRemove

Stateful vs Stateless Session beans-Differences January 25, 2008

Posted by Coolguy in J2EE, Java.
add a comment

State: Stateful maintains information across sessions while stateless doesn’t. If a transaction would span over two or more bean executions you should use stateful session bean, otherwise use stateless session bean. Stateful beans remember state between

    Scalability: Stateful beans hurt scalability.

    Pooling: Stateless beans, by nature, need not know their clients once the remote business method returns. These beans can therefore be bean-pooled. On the other hand stateful session beans may be requested back(with previous state) by a client using the javax.ejb.Handle reference that the client may have retained. In this case, the bean will need to be re-instated entirely. These beans therefore can only be instance-pooled and never shared between clients.

    Passivation: Stateless  beans are not passivated. SFSB’s are activated/passivated.

      Version 2.X:

      In ejb-jar.xml ‘session-type’ attribute determines whether the bean is stateful or stateless.


      Version 3.X

      Stateful beans import: import javax.ejb.Stateful

      Stateless beans import: import javax.ejb.Stateless

      Stateful Session Beans – Best practices January 25, 2008

      Posted by Coolguy in J2EE, Java.
      add a comment

      Stateful Session EJB is a server-side object designed to hold data on behalf of a particular client.

      SFSBs should be used to store session-oriented data. They hold the data on behalf of the client. Session-oriented data is used to track a multi-request sequence, ordering, or any associated data that is part of a sequence.

      SFSBs, however, have a limited lifespan and are not intended to survive server crashes. Although SFSBs are allowed to access a database and load data into memory, but the act of caching persistent data lies within the responsibilities of entity beans.

      The EJB specification suggests that a shopping cart for an e-commerce system could be implemented with SFSBs. This is perfectly acceptable if that shopping cart is only intended to be an in-memory implementation that does not need to survive a server crash. In reality, however, most implementations of shopping carts are required to survive server crashes; the data contained within the shopping cart needs to be persistent and transactional — with an in-memory data cache. i:e Using entity beans.

      When to use them ? 

      In very few J2EE systems !!

      Systems that have JSP/servlet front-ends should use HttpSession objects to store session-oriented state. Using both  HttpSession and SFSB is simply duplicating the effort.

      For systems that do not have a servlet/JSP front-end, SFSBs should be used to track session-oriented state similar to the way a web-based system would use an HttpSession object.

      Use SFSB’s along with  HttpSession when:

      Your app server doesn’t offer caching of HttpSession objects. This will mean that you may have to have to limit on number of sessions.  Using SFSB’s in this scenario will increase scalability as a  container can activate/passivate SFSB’s as needed.

      Data mapper January 22, 2008

      Posted by Coolguy in Java, Java Frameworks.
      add a comment

      Data mapper moves the data between objects and database keeping them independent of each other.

      With Data Mapper the in-memory objects needn’t know even that there’s a database present; they need no SQL interface code, and certainly no knowledge of the database schema

      Active record January 22, 2008

      Posted by Coolguy in Java, Java Frameworks.
      add a comment

      An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.

      Software Estimation with Three point estimates September 13, 2005

      Posted by Coolguy in Software Development.
      add a comment

      We all know theoretically,although we sometimes fail to acknowledge in practice, that project time and cost plan are guesses based on our best estimates.In some environments there there is a lot of historical data and expert knowledge around, that could be used to make that guesses as ‘educated’ as possible.Unfortunately when a type of project is being done for the first time in an organisation the chances of any guesses being correct is remote.
      When someone is asked to provide a single point estimate for a parameter, there is a little chance that it will be correct.
      An accurate estimate is a range of values that contains the correct value.Range is:

      • Minimum Value
      • Most likely Value
      • Maximum Value

      PERT formula can be used to get to a single point estimate from these range of values:

      Minimun +(4*Most likely) + Maximum



      Remember precision ‘sets us up’ for later perception of failure.

      If a project’s business case can stand up at the extremes of the ranges, there should not be any worry.

      If the business case stands up at the optimistic end of the range, the we have a problem.

      Outsource failure September 13, 2005

      Posted by Coolguy in Software Development.
      add a comment
      • While decisions about outsourcing IT and business processes continue to grow, the contractual side of relationships are failing nearly 60% of the time
      • Of the 58% of outsourcing contracts that do not work, four out of five fail due to poor leadership and control
      • Problems include a lack of initiative and a shortage of management skills by both customer and service provider alike, and these come together to undermine the main objectives and reduce expected returns by as much as 75%.
      • These ‘soft’ intangible issues are all too often overlooked during sourcing and negotiations, yet it is here where the foundations for success or failure are set
      • Companies exhibit five primary personality types in the neighbourhood with only one forming the basis of a strong relationship:
      1. The Curtain Twitcher
      2. The Hedge Builder
      3. The Noisy Neighbour
      4. The Trend Spotter
      5. The Good Neighbour

      The Curtain Twitcher
      Suppliers will find these companies curious, but not interfering. They will often complain to colleagues about their service providers’ short-comings, but not address the issue head-on. This irritable relationship, based on a sense of mutual suspicion, is often inherited by the company’s internal manager who may feel that there could be better supply options but the decision has been taken to continue with the existing arrangements.
      Remedy – A contract review should be implemented annually to ensure objectives are understood on all sides.

      The Hedge Builder
      Sets up a contract and expects to watch it happen without getting involved. This cuts off the possibility of the service provider advancing with the contract and working hand in hand with the client. There is a tendency for the client to keep ‘the roses well pruned’ on his/her side of the hedge and ignore the mess next door that may well be affecting property values for the whole street. The misguided belief is that outsourcing will cure all ills, once inefficient processes have been chucked over the hedge.
      Remedy – Generally a budget of 4-6% of the value of the contract is required to ensure an adequate in-house team to manage the relationship.

      The Noisy Neighbour
      An over zealous micro-manager prevents the service provider from getting on with the job. An obsession with the minute details can result in ‘analysis paralysis’ and confusion among colleagues. The tendency to escalate every service issue can interfere with the project’s progress and adversely affect the business goals on which the contract was struck.
      Remedy – In-house teams need to be reassigned to other tasks while new or different management skills are developed to ensure a proactive rather than interfering approach.

      The Trend Spotter
      The internal team, led by the ‘trend spotter’, has outsourced because it is the current trend in business service management. They have embraced help desk and IT maintenance outsourcing and currently are hurtling towards off shoring back office services. The pressure is coming from the top – 8 out of 10 IT Directors are pursuing off shore solutions, often fuelled by the perceived belief that outsourcing costs minus previous in-house costs equals cost savings. It doesn’t.
      Remedy – Companies should fully quantify the extent of an outsourcing opportunity before embarking on a long, difficult and expensive process that is fraught with risk.

      The Good Neighbour
      Represents only 20% of deals. Working from a win-win mentality, the time is taken to assess not only technical competency but also the business goals of the provider and ensure there is a cultural fit between both. Service provider personnel receive ongoing training and key staff are given individual incentives related directly to the client’s organisational objectives

      Application Tiers & Testing Frameworks September 7, 2005

      Posted by Coolguy in Testing.
      add a comment