Ngai: web development is not difficult anymore.

Thursday, July 30, 2009

Can we develop web without EJB and Spring with ease?

For the most java developer, they cannot do something that look like
"simple" or "easy". Most of us always put everything into the framework.
The framework supports everything even you couldn't imagine.
Have you ever imagined about Servlet that does not relate to HTTP?
The HttpServlet is extended from GenericServlet and GenericServlet
implements Servlet interface. I think 99% of us never use GenericServlet directly.

Java Application Server is the ideal example for "everything is inside it".
It seems like you don't need to do anything because it will do for you ,
but for the real life it's definitely not true. I said about <=EJB2
I don't know the benefit of using EJB2 except it looks like "Pro".
In recent year new concept of simplification come into the Java world.
The spring framework is the most famous framework for Java EE happened.
It seems like EJB will be replaced by Spring until EJB3 came out.
Now both EJB3 and Spring is the significant ingredient for the project.
Someone cannot live without it, it like addictive substance.
Someone means not all , the rest people still don't use EJB3 or Spring (or Guice)
for managing his/her enterprise system. They decide to design and implement
it by themselves. The reason is both EJB3 and Spring are still difficult to
understand at a glance. They need the time for investigate and look through
its document. But someone doesn't have the time to do so.

I'd like to introduce new generation lightweight framework to manage
your enterprise application with proven concept and the new concept
that I invent it. I know I'm not a expert person and you may think it just the
another frame(doesn't)work. Before judging me read the features first:
  1. Ngai glue JPA and Stripes Framework and its own Service, DAO
  2. Ngai supports annotation @PersistenceContext, @PersistenceUnit so you can access EntityManager and EntityManagerFactory easily.
  3. Ngai have its own annotations to help your task easier.
    @Inject - to inject your custom resource to service/DAO
    @Jndi - to inject JNDI resource (You may inject Datasource via this annotation)
    @Request - to inject HttpServletRequest to your service
    @NativeQueryMethod - mark the method to enable query magic.
    @QueryMethod - mark the method to enable query magic too. (I will explain about this later)
    @NgaiService - to inject another service to current service
    @NgaiDao - to inject another DAO to current DAO or service.
  4. Ngai has CRUD feature. It doesn't use code generation (both static and runtime)
    it just provide simple base Action, Service, DAO for the crud system. you can extend
    it and use default or override the default on your wish.
  5. Ngai doesn't force you to separate your application layer.
    The possible combination is
    - Web Action + Service
    - Web Action + DAO
    - Web Action + Service + DAO
  6. Ngai provides the most common code in every layer you can use or don't use.
In fact the feature is much more than this. but I'm not the technical writer I love writing
software more than its document. Please wait a moment I'm working on the example
and document for Ngai-Framework.

Tuesday, July 28, 2009

The first post is telling the world what I'm doing

I'm a software developer and I have a bad luck because since I started
the work (for money) until now, I never satisfy my job. All projects that
pass through my working life is quite suck. Especially web project.
No pattern (or maybe it has) but with a lot of exceptions and finally every
Java EE project is quite bloat and messy. I used to work with many people
although now I work with a few people. The common problem for new
developers (may be including old developers) is they don't know how to
design the system I mean how to design the code. separate the Class
by its responsibility, separate the method by its functionality and naming.
The naming convention is the classic problem even if Java has the
standard naming convention that anyone can download. http://java.sun.com/docs/codeconv
I always found the guy that stick with his naming convention and have
the difficulty when I ask them for changing.
By the way naming convention is easy to follow if you have the open mind
but the difficult thing is not naming convention but it is how to name the
class, method, variable and package. IMO it is the art.

Another bad luck for me is no one around me is smart in programming
(This may wrong because I'm not the good one and may miss something)
I would like to be a smart programmer. so I try (moderate) hard by
reading many books, articles , documents and blogs. I know I cannot
change people around me to do what I think. I can change only one guy,
that's me.

The first problem that I want to eliminate is the lack of programming
design art in the head of people around me. I would like to make the simple,
and if possible the simplest web framework for them and me.
The framework that provides the comfortable with flexibility.
Type less do more is still the interesting idea.

Now while I'm writing this blog post with ironic style. My framework
was finished. It is in alpha state of development because I've a plenty
of features that have not been implemented yet and many bugs to be
discovered (No test case because the code re-factoring happens frequently)

My framework built on top of the great existing one ,
Stripes framework, and able to wire many thing into it with easy to
use annotation. Framework was totally built from my experience both
coding and reading.
Many people suggest to separate layer of responsibility to
at least 3 layers. For the view of development is MVC and for the view
of software architecture is Domain , DAO , Service, Presentation.
My framework can apply all or some of it with ease. The strength point
of my framework is Service, DAO, Resources, ... dependency injection
and move the cross cutting concern logic into framework.
Developer just write the code without the question because the framework
have already solved many problems. developer will not stuck on
the way anymore. (This help me from reading unpatterned
and scattered code.

I've forgot to tell you the name of my framework. I call it "Ngai" .
I didn't intend to give the god name for it (Ngai the God) but Ngai
can pronounce "Ng-ai" in Thai language means "Easy" and the slogan
of the framework is "Ngai - nothing is difficult except pronouncing its name"

I decided to open the Ngai source code to everyone. Yes I will release it as
just another opensource software with business friendly license Apache license v2

This time I just want to tell you what I'm doing.
The next time I will post the feature set of Ngai framework. Please stay tuned.

Followers