In this article, I am going to show you how to get job done within jdonframework.xml for class testService.
We called the class invoked by client (Servlet/Jsp/Action) as service class. There are two types of service class. One is common java class or JavaBeans, all of which called POJO. The other is EJB-regulation-complied classes which could be simply called EJB. Any of these two type class could be used as service class, hence there will be two corresponding service configurations for POJO and EJB done by proService and jbService respectively.
Common service class configuration
There are two basic properties in pojoService, name and class. Property class is for putting POJO’s full name. Property Name is used to put the actual service name invoked in the program, conventionally written as similarly to the class name. Please see the source code in JdonFrameworkEJB or Ioc under Traning directory.
<!—common java class configuration also called POJO à
Not all of classes are servered for the client directly (jsp/Servlet), that is to say some classes are not invoked by jsp/servlet or presentation frame layer, but invoked by service classes, these kinds of class we called component class annotated as component in configuration file. Note: in EJB framework, component class is managed by EJB container, so you do not need to any configuration in JdonFramework any more.
Here is a common example.
<!—jdbcDAO is invoked by TestServiceImp and serving for it, -->
As you can see, JdbcDao’s constructor has a string parameter. When you initialize an instance of JdbcDao, String “java:/TestDs” will be passed into constructor automatically.
By taking advantage of good point above, we can conveniently utilize xml file to define business logic. For example, we can defined the email format in jdonframework.xml so that email content could be altered easily according the customers’ needs. It is much better and flexible than get this information hard coded in the program.