- Complex Products
- Unmaintainable System
- Non-portable, frame-work committed business components
- Unpredictable System
- Why EJB 2.0 is complex / complicated?
- Session bean - to write say hello method
in EJB 2.x, you need to write
home interface
component interface
bean
in EJB 3.x, you need to write
interface (with annotation)
bean (with annotation)
EJB 2.x; lookup is the only way to get server object/resource
EJB 3; DI (dependency injection) & lookup are the available way
there are more points. But basically, with EJB 3 responsibility of container is heavy & responsibility of developer is light weight; so that development is less & maintenance is easy.
- Session bean - to write say hello method
Primitive Obsession is the name of a code smell that occurs when we use primitive data types to represent domain ideas. For example, we use a string to represent a message or an integer to represent an amount of money. For Example: Code with Primitive Obsession // primitiveObsession.java public class primitiveObsession { public static void main ( String args []) { Integer [] cityPopulations = { 13000000 , // London 21903623 , // New York 12570000 , // Tokyo 1932763 , // Stockholm 1605602 , // Barcelona 4119190 // Sydney }; for ( Integer cityPopulation : cityPopulations ) { System . out . println ( cityPopulation ); } } } public class City { private final String name ; private final int population ; private final Continent continent ; public String getName () { return name ; } public int getPopulation () { return population ; } public Continent ge...