Navigation
Home
SourceForge Home
Articles on Java
Getting Started
Essence Documentation
Download
Contact
Get rewarded for helping out
Email A Question
Weblog
|
Articles Home
Overview.
-
Quality application development can ensure a faster delivery of a successful
project.
-
Good configuration management tries to ensure there is a value
in each added class or library. Avoid starting with a solution looking
for a problem to solve.
-
There are numerous frameworks in the web/presentation layer,
but fewer frameworks designed for the backend/integration layers.
What is a framework?
-
A set of design pattern and conventions.
-
Consists of foundation modules which support the application,
and tool kit modules which are used by the application directly.
Why use a framework?
-
Allows developers to concentrate on code which specific to
their application.
-
Code can be reduced to just the business logic making it
simpler to change and maintain.
What is a component?
-
A component is the smaller configurable object or collection of objects.
-
A component fulfils a specific role or purpose and is
replaceable by another component which does the same.
-
A component is an instance of an implementation. Multiple components can use the same code but be configured differently.
Framework: Risks
What risks should you consider when choosing a framework?
-
Learning Time/Cost
-
Balance between Quality deployment and Rapid prototyping.
-
Support and maintenance.
-
Rapid development - or very slow development!
-
Lock-in, how easy is it to replace with another framework.
-
Insidiousness, if I start using the framework, do I end up
having to use it everywhere.
-
Lack of Documentation, how easy is the framework to misuse?
Framework: Features
What features might a framework provide?
-
Component management; configuration and object graph
construction.
-
Inversion of Control.
-
Support for Separation of Concern
-
Component lifecycle management.
-
Support for a presentation layer for applications or data
provision.
-
Support for a persistence layer either to persists application
data or integrate with an existing database.
-
Support for loosely coupled application integration such as
messaging or web services.
Different styles of Frameworks.
Picocontainer
http://www.picocontainer.org/ - "PicoContainer
is a highly embeddable container for components that honour the Dependency
Injection pattern."
The home page has a good documentation of Dependency Injection and Inversion
of Control.
Advantages
- Simplicity. No dependencies on other libraries.
- Well documented.
- Support for hiding the implementation and adding thread safety.
Disadvantages.
- Multiple ways of doing the same thing.
Spring Framework.
Advantages
- The purpose of Spring is to make using the JEE environment simpler.
This is useful if you are committed to a JEE container but find it too
cumbersome.
- Spring provides integration with a wide variety of open source
libraries. In some cases, the spring distribution can be used just to get a tested combination of open source libraries.
- Widely used and most asked for in job descriptions. This means it is
easier for employers to find skills in this area and more reason for
developers to learn it.
Disadvantages.
- Typical usage can lead to programming in XML which is effectively a
runtime checked scripting language. A quality deployment relies on
testing all possible branches to ensure the application will not have a
runtime in production.
- Adding code/configuration is very easy. However removing code from
large configurations can be a risk which large projects don't take.
This can result in large sections of dead code which no-one is willing to
make the effort to determine it is not needed or the risk that it might be
needed at runtime. This has been the case in one application I worked on in
which the configuration was 34,000 lines of XML.
- Heavy reliance on JavaBean style components which can complicate
validation. Some support of constructors and other "exotic" forms of
construction.
Guice Framework
Advantages
- Compile time binding through the use of annotations for injected values.
This supports some code analysis and refactoring techniques.
- Faster than Spring's container.
Disadvantages
- Heavy reliance of guice's annotations and the need to create
annotations.
- Constructing the configuration is like a language in itself.
|