第一部分翻譯
Configuration quick guide
With a few lines of configuration, JDon Framework can be easly entegrated into your application. Here is an example:
TestService testService = (TestService) WebAppUtil.getService("testService ", request);
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 à
<pojoService name="testService" class="com.jdon.framework.test.service.TestServicePOJOImp"/>
Common class configuration
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, -->
<component class="com.jdon.framework.test.dao.JdbcDAO" name="jdbcDAO"/>
We often need to define some constants and parameters in some classes, so we can do like this:
<component class="com.jdon.framework.test.dao.JdbcDAO" name="jdbcDAO">
<constructor value="java:/TestDS"/>
</ component >
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.
Here is an example:
<component name="emailDefine"
class="com.jdon.jivejdon.service.imp.account.EmailDefine">
<constructor value="Jdon:username and password"/>
<constructor value="hello:your username and password for jdon.com is listed as follows:"/>
<constructor value="Jdon.com --- clarify your confusions and answer your questions"/>
<constructor value="Jdon.com"/>
<constructor value="admin@jdon.com"/>
</component>
With a few lines of configuration, JDon Framework can be easly entegrated into your application. Here is an example:
TestService testService = (TestService) WebAppUtil.getService("testService ", request);
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 à
<pojoService name="testService" class="com.jdon.framework.test.service.TestServicePOJOImp"/>
Common class configuration
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, -->
<component class="com.jdon.framework.test.dao.JdbcDAO" name="jdbcDAO"/>
We often need to define some constants and parameters in some classes, so we can do like this:
<component class="com.jdon.framework.test.dao.JdbcDAO" name="jdbcDAO">
<constructor value="java:/TestDS"/>
</ component >
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.
Here is an example:
<component name="emailDefine"
class="com.jdon.jivejdon.service.imp.account.EmailDefine">
<constructor value="Jdon:username and password"/>
<constructor value="hello:your username and password for jdon.com is listed as follows:"/>
<constructor value="Jdon.com --- clarify your confusions and answer your questions"/>
<constructor value="Jdon.com"/>
<constructor value="admin@jdon.com"/>
</component>
相關文章
- QT TS檔案翻譯,部分不能正確被翻譯QT
- MySQl引數管理( 部分翻譯)MySql
- [翻譯]現代java開發指南 第一部分Java
- SpringAop英文文件部分翻譯Spring
- Tensorflow Python API 翻譯(math_ops)(第一部分)PythonAPI
- [翻譯]對於感知和認識的新理解:第一部分
- Vue.js 3.0 PPT(附部分中文翻譯)Vue.js
- The Pragmatic Programmer 翻譯(前言章節部分) (轉)
- [Flutter翻譯]使用Flutter WEB實現桌面GUI(第一部分:介紹)FlutterWebGUI
- J2EE Development without EJB序言的第一部分的翻譯dev
- [翻譯]Redis: 三十分鐘從入門到精通 - 第一部分Redis
- 文字識別——檢測部分 CTPN論文翻譯
- Income sheet報表專案的部分翻譯
- RFC1952的部分翻譯及原文 (轉)
- Laravel Baum 巢狀集合模型中文文件翻譯-部分Laravel巢狀模型
- hadoop官網翻譯第一天Hadoop
- RFC1951的部分翻譯及原文(1/2) (轉)
- RFC1951的部分翻譯及原文(2/2) (轉)
- [譯] Erlang 之禪第一部分
- The art of software testing翻譯–第一章薦
- 翻譯
- Yurii談翻譯(五)怎樣翻譯更地道:so…that…的翻譯
- 如何完成中文翻譯日文線上翻譯
- [譯] 是的,重新設計(第一部分)
- Yurii談翻譯(四)怎樣翻譯更地道:翻譯如鋪路
- Yurii談翻譯(九)怎樣翻譯更地道:冠詞a的翻譯
- Yurii談翻譯(十)怎樣翻譯更地道:最高階的翻譯
- 翻譯的未來:翻譯機器和譯後編譯編譯
- Ubuntu安裝劃詞翻譯軟體Goldendict 單詞翻譯 句子翻譯UbuntuGo
- Yurii談翻譯(六)怎樣翻譯更地道:“as somebody said…”的翻譯AI
- Yurii談翻譯(十三)怎樣翻譯更地道:It is…that…句型諺語的翻譯
- Yurii談翻譯(十四)怎樣翻譯更地道:否定句的翻譯
- 蝴蝶書-task2: 文字推理、摘要、糾錯 transformers實現翻譯 OpenAI翻譯 PyDeepLX翻譯 DeepLpro翻譯ORMOpenAI
- Nginx翻譯Nginx
- [翻譯] TransitionKit
- 翻譯篇
- OllDbg翻譯LLDB
- [譯]ES6入門(第一部分)