Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more... contact@tech-rocks.org

Tuesday, October 22, 2013

XmlBeanFactory class

The most commonly used BeanFactory implementation is the XmlBeanFactory class. This container reads the configuration metadata from an XML file and uses it to create a fully configured system or application.

Spring IOC Containers

There are two types of IoC containers:

  • Bean Factory container: This is the simplest container providing basic support for DI .The BeanFactory is usually preferred where the resources are limited like mobile devices or applet based applications

  • Spring ApplicationContext Container: This container adds more enterprise-specific functionality such as the ability to resolve textual messages from a properties file and the ability to publish application events to interested event listeners.

Aspect-oriented programming - AOP

Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules.

Benefits of IOC

  • Minimizes the amount of code in your application.

  • Makes your application easy to test as it doesn't require any singletons or JNDI lookup mechanisms in your unit test cases.

  • Loose coupling is promoted with minimal effort and least intrusive mechanism.

  • IOC containers support eager instantiation and lazy loading of services.

Spring Dependency Injection Concept

This concept says that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (the IOC container) is then responsible for hooking it all up.

 

2 Types:

 

  • Constructor-based dependency injection: Constructor-based DI is accomplished when the container invokes a class constructor with a number of arguments, each representing a dependency on other class.

  • Setter-based dependency injection: Setter-based DI is accomplished by the container calling setter methods on your beans after invoking a no-argument constructor or no-argument static factory method to instantiate your bean.

 

Since you can mix both, Constructor- and Setter-based DI, it is a good rule of thumb to use constructor arguments for mandatory dependencies and setters for optional dependencies. Note that the use of a @Required annotation on a setter can be used to make setters required dependencies. The Spring IoC creates the objects, wire them together, configure them, and manage their complete lifecycle from creation till destruction. The Spring container uses dependency injection (DI) to manage the components that make up an application.

Spring Modules

  • Core module

  • Bean module

  • Context module

  • JDBC module

  • ORM module

  • Expression Language module

  • OXM module

  • Java Messaging Service(JMS) module

  • Transaction module

  • Web module

  • Web-Servlet module

  • Web-Struts module

  • Web-Portlet module

Spring Framework Benefits

  • Lightweight: Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB.

  • Aspect oriented (AOP): Spring supports Aspect oriented programming and enables cohesive development by separating application business logic from system services.

  • Exception Handling: Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO, for example) into consistent, unchecked exceptions.

  • Container: Spring contains and manages the life cycle and configuration of application objects.

  • MVC Framework: Spring's web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks such as Struts or other over engineered or less popular web frameworks.

  • Transaction Management: Spring provides a consistent transaction management interface that can scale down to a local transaction (using a single database, for example) and scale up to global transactions (using JTA, for example).

  • Inversion of control (IOC): Loose coupling is achieved in spring using the technique Inversion of Control. The objects give their dependencies instead of creating or looking for dependent objects.

Friday, October 18, 2013

Thursday, October 10, 2013

Tuesday, October 8, 2013

Google Web Designer Tool

Create engaging, interactive HTML5-based designs and motion graphics that can run on any device.

gwt

Check this link