Client Server Service Software(CS3) by jtl17221

VIEWS: 0 PAGES: 38

									Client Server Service &Software(CS3)                                Thought & Manual




            Client Server Service
                             3
              &Software(CS )
             Thought&Manual



                                       Author:Song Naihui &Haiyan

                                       Email:songnaihui@sohu.com
                                       Home:    001-405-332-0838
                              Mobile: 8610-13810301888(Mr Song)
Client Server Service &Software(CS3)                                                                             Thought & Manual




                                                                  目         录
1    INTRODUCE .............................................................................................................................. 1
    1.1    AIM ......................................................................................................................................... 1
    1.2    PROJECT BACKGROUND .......................................................................................................... 1
    1.3    SCOPE ..................................................................................................................................... 3
    1.4    DEFINITION ............................................................................................................................. 3
    1.5    REFERENCE ............................................................................................................................. 4
2    SUMMARY OF CS3 FRAMEWORK ....................................................................................... 4
    2.1    WHAT IS CS3 FRAMEWORK?.................................................................................................... 4
    2.2    HOW DOES IT WORK?............................................................................................................... 5
    2.3    WHAT CS3 FRAMEWORK CHANGES OUR DEVELOPING PRACTICE? ........................................... 5
3    TECHNOLOGY ADVANTAGE ................................................................................................ 5
4    DETAIL OF CS3 FRAMEWORK ............................................................................................. 8
    4.1    CS3 FRAMEWORK LOGIC DIAGRAM ........................................................................................ 8
5    DESCRIPTION OF CS3 MANIPULATION ....................................................................... 19
6    DESCRIPTION OF GML(GRAPHICS MARKUP LANGUAGE) ..................................... 28
    6.1    ROOT NODE .......................................................................................................................... 28
    6.2    CONTAINER ........................................................................................................................... 29
    6.3    EXPLANATION OF ID AND CONSTRAINTS ATTRIBUTE: .......................................................... 30
    6.4    COMPONENT:LABEL: .......................................................................................................... 30
    6.5    COMPONENT:BUTTON: ........................................................................................................ 30
    6.6    COMPONENT:TEXTFIELD ....................................................................................................... 31
    6.7    COMPONENT:TEXTAREA ....................................................................................................... 31
    6.8    COMPONENT:DATEFIELD ....................................................................................................... 31
    6.9    COMPONENT:COMBOBOX...................................................................................................... 32
    6.10    COMPONENT:RADIOBUTTONS ............................................................................................ 32
    6.11    COMPONENT:CHECKBOX ................................................................................................... 33
    6.12    COMPONENT:LIST .............................................................................................................. 33
    6.13    COMPONENT:TREE ............................................................................................................. 33
    6.14    COMPONENT:TABLES: ..................................................................................................... 34
7    SCENARIO................................................................................................................................ 35
    7.1    DEMO CODE OF GML ............................................................................................................ 35
    7.2    DEMO CODE OF JAVA FILE GENERATED BY CS3....................................................................... 35
    7.3    DEMO CODE OF CALCULATE RELATION GENERATED BY CS3 .................................................. 35
8    SUCCESS CASE ....................................................................................................................... 35
    8.1    BACKGROUND OF CASE ........................................................................................................ 35



                                                    Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




1     Introduce
1.1    Aim
    This document explain some thoughts and how to use this tool, meanwhile this
document will give some supports of technology.
1.2    Project Background

With the fast development of Internet, Java technology was used widely and widely. But the
developer encounter one big trouble whether he (she) apply Java tech into J2SE,J2EE or
J2ME.That is how to develop GUI application. Modern software requires the Graphics User
Interface more friendly than before besides powerful performance and easy usability. It is
well known that developing GUI is more complicate and cumbersome correspondingly the
Muti-thread and Cross-Platform which is the Java tech attribute. That is why a lot of
developer complain for using Java.


At the begining Java GUI was introduced into the domain of Applet, but recently more and
more International IT Solution Company have applied GUI into huge application system :
BEA Workshop8.1,IBM WebSphere,Oracle 8I,9I,Inprise Jbuider and so on, and gained
very excellent response from market. Sincerely speaking the performance whether for
space or speed hasn’t any comparison with other native code language, But the hardware
configuration of computer become so advanced than 8 years ago that each PC have the
precondition to run GUI application. Sometimes some GUI application must be
implemented by java in order to supply one whole J2EE architecture which become the
main multi-tier application solution, So the solution for improve the developing performance
and efficiency of Java GUI will consequentially step into a very important stage just like
other language. The case of success Jbuilder give us the annotation of the role of Java GUI
application.


On the one hand Java application surely become one important role in the application
system, on the other hand GUI application programming using java absolutely is one
nightmare for programmer because of complicated layout manager and diverse event


We face one contradiction for the reason that we short of programmer for developing Java
GUI application compared with a large number of JSP, Servlet programmer. This quandary
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                                  Thought & Manual




was formed owing to few third-part supply solution for speeding the progress of application.
Lots of framework for JSP and Servlet was introduced into programming practice, Such as
Struts(JSP,Servlet),WAF (Web Application Framework EJB Solution ) and so on.So
suggest one applicable Framework for GUI application surely change this situation and
bring Java Application a bright future.


               Table 1: Comparison of Current Framework for Java Solution


For            Full Name Apply                   Main tech            Original        Short description
Short                            area
                                                                      Fee
WAF            WEB               EJB(WEB) EJB                         Sun             Pet Store blueprint for J2EE
                                                                                      SUN
               APPLICATION                                            FREE


               FRAMEWORK
Struts         Struts            WEB Tier        JSP,TagLib           APACHE          Open source of Apache
                                                                                      Implementation of MVC
                                                 JavaBean,XML         FREE            Based on JSP. This
                                                                                      framework was applied
                                                                                      widely
Turbine        Turbine           WEB Tier        servlet              APACHE          Open source of Apache
                                                                                      Based on Servlet and Web
                                                                      FREE            Service with high speed
JATO           SUN ONE           WEB Tier        JSP,TagLib           SUN             Commercial framework is
                                                                                      applicable for small web
               Application                       JavaBean             FREE            application. Suggested by
                                                                                      SUN for the platform of Sun
               Framework                                                              One
TCF            Thin-Client       JAVA            JAVA                 IBM             Suggested by IBM
                                                                                      Implemented MVC pattern,
               Framework         GUI             Application          license:2000$   Serve for JAVA Application


Application frameworks are becoming increasingly important for developing complex
applications, because these application frameworks help application designers deal with
complexity by allowing the designers to “capture the essence of successful patterns,
architecture, components, policies, services, and programming mechanisms.” As a result,
applications are “correct, portable, efficient, and inexpensive.” An application framework
describes a set of interacting components and services available to an application,
describes the responsibilities of components and services, and describes the interactions
between the components and services. A developer creates an application by composing
                                        Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




and extending the components and services available in the application framework.
From the list we can follow that many frame work have been proved well work through
practice with much benefit to developing company and also some programmers, but this
Thin-Client Frame Work adopted by IBM is still in the state of concept with less realization
in real project. The main reason is that although this frame work provide the solution of GUI
components and realize the structure pattern of MVC, this frame work didn’t support how to
rapidly apply this into huge project. Although the system structure with logic perspicuity the
framework cant save developing time. Based on those reason this frame work can’t spread
widely. But other company didn’t supply other solution for Java GUI, so the suggestion of
Java GUI frame work and the solution based on this frame work will surely impulse the
application of GUI client.

1.3   Scope
The development company and developers who use Java as main developing language.
1.4   Definition
         JAVA GUI:JAVA Graphic User Interface
         Framework: Half-baked Product or a suit of components which support
          you finish your own application system using this suite. Simply saying
          framework’s aim is supply you one stage and you are the actor.
         Framework patterns: The Framework patterns for business are a group of
          proven, reusable assets that drive the design, development, and deployment
          processes as follows. An application designer first chooses one of a number of
          business patterns that most closely matches the interaction between participants in
          the desired e-business solution. An individual business pattern offers the choice of
          several application topologies; the different application topologies associated with a
          business pattern account for differing customer requirements and lead to a
          particular configuration that focuses principally on the relationship of the application
          logic and associated data, but does not mandate where middleware runs or where
          data might be stored. A particular application topology offers multiple run-time
          topologies, each of which offers a different grouping of the functional and
          operational components within interconnected logical nodes; each node represents
          a set of components that provide either infrastructure or application components of
          the types to be described below. A run-time topology can then be implemented with
          many physical patterns, each of which maps specific products from the Framework
          platform, described below, to the run-time topology to instantiate the solution. The
          actual physical pattern chosen depends on factors such as existing systems,
          available skills, desired quality of service, scalability, and reliability. Additionally, the
          Framework provides pattern-specific guidelines for the design, development,
          deployment, and management of e-business applications based on the specific
          product mappings chosen.

         Model-View-Controller design pattern
          The MVC pattern is at a higher level of abstraction than class relationships. It
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




          describes the overall application design and is sometimes called the MVC
          framework or architecture. The MVC pattern neatly accomplishes the goal of
          separating presentation from business logic by dividing an application into three
          components:
          Model -- The data and its associated business logic
           View -- The presentation of the data
          Controller -- Means of manipulating the model via the view (to allow user
          interaction)
          By encapsulating functionality in well-defined components with limited
          dependencies on other components, the MVC design provides many benefits,
          such as:
          1. Different teams, with different strengths, can work on different parts, largely
              independently. One team, comprising Java developers, may work on the
              Controller and Model, while another team, comprising Web designers, may
              work on the View.
          2. Components can be replaced. For example, a Web-based View could be
              replaced by a dedicated client application or by a Web services interface, with
              little or no change to the Model or Controller components.
          3. Components can be deployed more flexibly. If performance becomes a
              problem because of increased traffic, for example, components can be moved
              onto separate servers.



1.5   Reference
      http://www-900.ibm.com/developerWorks/cn/java/j-tcf1/index.shtml
      http://www-900.ibm.com/developerworks/cn/java/j-tcf2/index.shtml

2     Summary of CS3 Framework
Just for the reason analyzed above I try to find some materials related with Framework and
make my great efforts to suggest one solution in order to change the status of Java GUI
predicament. With the improvement of my thought lots of solution for GUI are emerging
from my cerebrum. Luckly I catch them and transform them into the CS3 Framework

2.1   What is CS3 Framework?

CS3 Framework is a design, development, and deployment approach for easily and rapidly
developing high-function, extendable, and responsive e-business clients in Java.                   CS3
Framework builds on the Model-View-Controller and Swing design patterns and raises it to
the application architecture level. Through consistent application of an event model, it
provides a highly pluggable and componentized structure for client development. The

                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




learning curve is reduced, development skills are easily partitioned, and cost estimation is
simplified. CS3 Framework can develop Java GUI application by dragging and dropping
components, After your designing this framework can generate HTML conform to Struts
Web Framework and also comply with the standard of DAO suggested by me.


2.2    How does it work?
The CS3 Framework is an architectural pattern that defines how to write Java client
applications and Web Client application. It separates coding concerns and responsibilities.
Its high degree of modularity provides for maximum re-use. It is compatible with multiple
data and server and network models, and it enables clients to be as thin or thick as needed.
It supports a process that provides a formula-based approach to estimating development
costs, and it enables parallel component development on the client while supporting
concurrent development of client and servers. CS3 Framework also provide one database
access solution based on the DAO access Frame work via Enterprise Java Bean deployed
on the application server. Based on the CS3 Framework we can design one View easily and
rapidly with the help of GUI Designer .

2.3    What CS3 Framework changes our developing practice?
No needing write cumbersome code on the view part and data modal, only putting your
effort on the business handler (controller), All those mentioned can be generated
automatically. Compared with custom developing method this Framework can improve
the efficiency more than 2 times, Time is money. Once you gain high efficiency you can
reduce the amount of developing personnel, The less personnel the less money you
expend. That is CS3 Can Save time, Save money, Speed. What you obtained is more
applicability in this dog-eat-dog commercial competition.

3     Technology advantage
Feature of this framework and the feature of CS3 software based on CS3 framework.

       Comfortable and rapid visual design of Java TM/Swing user interfaces

       No programming skills required

       Immediate preview of the created GUI just at the design process

       Code is generated automatically – XML files are used to store created GUIs

       Support of various layout managers

       Localization of created user interfaces

                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




      Direct mapping of events to object methods

      Integration of external Java Beans

     Comfortable and rapid visual design of Java TM/Swing user interfaces
     GUIs can be created by drag and drop as it's offered for example by Visual Basic ®
     or PowerBuilder ® .

     No programming skills required
     Experts of design and layout, who do not necessarily have programming experience,
     can easily work with CS3

     Immediate preview of the created GUI just at the design process
     In one window GUI components are placed and their properties are set. In a second
     window the resulting layout is updated on the fly. There is no need to recompile and
     run the application to verify layout changes. Required time to develop even complex
     layouts is reduced dramatically.

     Code is generated automatically – XML files are used to store created GUIs
     Instead of writing complex and cumbersome Java code, CS3 makes use of XML files.
     This allows to change the visual appearance without recompilation. Once you have
     designed one view by dragging and dropping the components one designer view, CS 3
     can generate source code of GUI view file, some stub of controller, some CMP Entity
     bean, BMP Entity Bean, and DAO. Just wait a while!

     Support of various layout managers
     The most important layout managers GridbagLayout, FlowLayout, Border layout and
     Null-Layout are supported

     Localization of user interfaces
     CS3 supports the translation of button texts, labels, tooltips and other widget properties
     using resource bundles.

     Integration of external Java Beans
     The CS3 provide one opening standard for using external Java beans.

     Direct mapping of events to object methods
     GUI events can be handled in any object method for which CS3 has installed the
     appropriate listeners.

     Other
         Printing of the current GUI
         CS3 is the easiest way to create windows-like java-programs and applets for JAVA
          platforms, View have less relation with business logic which release developer’s
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




          capability. Simplify the process of dealing with event, If developer familiar with XML
          Node definition he will write descriptor of GML(Graphics Markup Language) and
          CS3 supply “what you see is what you get” tool in order to define the GUI.
         Utilize abundant Swing components
         Components are managed unite, we can access the component by name which
          supply much expediency.
         All GUI components are defined in one XML file, the definition of GUI components
          can be used in other view .Through this CS3 improve the reusability.
         The easiest mechanism in order to define new component. All GUI components
          extend one Interface, programmer can define new GUI component according to
          the component standard which abide by Java Bean standard, meanwhile all events
          are also abide by Java Bean event mechanism.
         All views can be aggregated easily, all views can be viewed as components, we
          can utilize this component into another view. This thought come up to Component
          Oriented Programming.
         Have the performance of auto test, we can simulate the real situation based on
          XML file.
         More look and feel, user can add look and feel by himself.
         General print support
         Strict exception mechanism,user can catch exception message .
         General storage policy, user can bind data with RDBMS or other storage structure.
          This framework will automatically matching data model without programming in
          order to save more time for dealing with business logic.
         Generate Entity EJB automatically abide by EJB standard.
         Generate DAO automatically abide by DAO Frame work
         Adopting ant as compile tool, user can compile and run the code generated by CS 3
          in the same IDE
         Generate GUI source code automatically abide by CS3 GUI framework
         Use the new project wizard to build your first application,
         Define method invocations in XML and use them in your business objects at the
          server




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                                                           Thought & Manual




4     Detail Of CS3 Framework

4.1    CS3 Framework Logic Diagram

                     <<Abstract>>
                      CS3Object
                      (from component)

                                         1..*
                                                                                                                       CS3CallBack
                                                                                                                      (from controlers)
                                                                       CS3GridbagPanel
                                                                          (from views)
                                                                                   *


                                                                      CS3BorderedPanel
                                                                                   1
                                                                          (from views)




                                                                             CSView                                   CSControler
                                                                           (from views)                              (from controlers)




        CS3TextField                     CS3Button                AView                   BView           AController               BController
         (from component)            (from component)         (from controlers)       (from controlers)   (from controlers)        (from controlers)




                1                              1
         JTextField                      JButton
         (from component)            (from component)




4.1.1 Explanation of Logic Diagram:
From this diagram we may put our focus on the part of CSView and CSController. AView
and BView all extends CSView, AControler and BControler all extends CSControler. Every
view must extends CSView just like each controller must extends CSControler. The details
will be explained particularly.


4.1.1.1 View

View section is main part of CS3 framework, all components was managed by view. These
components are stored by name, we can access these components by name just like
access EJB components.
For example we can put one CS3TextField named “taxpayer ” into the view just like the
following.

      CS3TextField taxpayer = new CS3TextField("taxpayer");
      taxpayer.setFont("Dialog,0,12");
      taxpayer.setBackground(new Color(0xccffcc));
      taxpayer.setEditable(true);
      taxpayer.setColumns(20);
      this.getHashMap().put("taxpayer", taxpayer);


                                                        Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




You must think this is also troublesome for writing those codes. Yes, but all codes in this
demo are generated automatically by CS3 via the GML you designed on the GML designer,
That is it is not wrote by you but by .CS3 solution.

All views extend CSView which declare initForm(),resetForm(),submitForm() and other
function make you access data model with more convenience


     public class CSView extends CSBorderedPanel
     {
     protected CSControler controller;
     public void setController(CSControler control)
     {
       controller = control;
     }
     public CSControler getController()
     {
         return controller;
     }
     public void updateView(Map map)
     {
         Iterator iterator = map.keySet().iterator();
            while (iterator.hasNext())
            {
              String keyName = (String) iterator.next();
              CSObject object
     =(CSObject)this.getHashMap().get(keyName);
              object.setValue( (String) map.get(keyName));
            }

      }
     }



From this diagram we can realize that access the components by name will make
managing the components very easily. And all components extend one class so we can
invoke the method to control component’s property. This convenience can be showed by
the function of updateView



4.1.1.2 Controler

Controller is business logic handler, at the same time has the responsibility of view logic.
Everything we should do in the frame work of CS3 is writing your business logic in this part.
Through controller we connect view with data modal. From Logic diagram we know that
every controller extends CSControler, This class implement the interface of CSCallBack,
and declare some core function in order to facility manipulating the model via the view.

                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                                 Thought & Manual




4.1.1.3DAO & Entity EJB

DAO & Entity EJB are data modal of system. Via these data modal we can get data
resource from RDBMS, XML or other format data. This part’s codes are also can be
generated automatically based on the GML you defined in the Workshop Designer.

4.1.2 The Package structure of Client Site


4.1.2.1 Package Diagram Of Client Site


          Project        :CS3 Frame work
          Version        : V1.00
          Description:   :GUIFramework controlers Class Diagram
          Modify :2003-11-21
          Author         :Song Naihui
          History :
                         Version Date            Author                         Description

                              1.00     2003-06-21           SongNaihui          Original Version



                        views               controlers            component




This framework contains three packages, one is package for views another one is package
for controller the last one contain the structure of GUI components. Explanation will be
introduced in the followings.

4.1.3 Explanation of MVC


4.1.3.1 Section Of View




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




View Section is main content for construct one GUI View
All defined components are managed by CS3GridbagPanel, CS3GridbagPanel can add
CSObject adopting GridBagLayout manager. Some CS3GridbagPanel compose
CS3BorderedPanel. From the diagram we can acknowledge that all view should extends
CSView


4.1.3.2 Section of Controller




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




控制器部分是业务逻辑处理调度的核心:
所有的业务是基于事件驱动的,事件通过 CS3CallBack 来统一回调,通过访问 BaseView 中的
组件来控制业务组件的属性变化,对于不同界面均配有一个控制器。在控制器中实现事件的
回调函数。对于数据模型的访问引进 ApplicationHelper 来与后台的对象进行通讯。其中
BaseControler 缺省地实现了 CS3CallBack 中声明地方法而作为系统事件调度地缺省适配器。
如果具体地 Controler 想实现某一个特定地事件处理那么就覆盖适配器中对应地方法就可以
了。




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                                                                                                  Thought & Manual




4.1.4 Mechanism of Event Dispatching


4.1.4.1 CS3CallBack


     Project        :CS3 Frame work
     Version        : V1.00
     Description:   :GUIFramework controlers Class Diagram
     Modify :2003-11-21
     Author         :Song Naihui
     History :
                    Version Date           Author          Description
                    1.00    2003-06-21     SongNaihui      Original Version




                                                                              <<Abstract>>
                                                                                CS3Object


                                         CS3CallBack
                                       (from controle...




                                                                CS3CheckBox                   CS3Button   CS3Label        CS3ComboBox       CS3List       CS3Table     CS3RadioButton
           CS3TextField                 CS3TextArea




          +textfield                   +textArea                +checkbox                    +button      +label                                        +table         +radioButton
                                                                                                                           +combobox    +list
              1                          1                        1                           1           1                                 1              1              1
            JTextField                  JTextArea                JCheckBox                    JButton     JLabel           JComboBox         JList       DefineTable   JRadioButton
                                                           1




                                                                                                                                                            JTable




                                   <<Abstract>>
                                    CS3Object
                                    (from component)

                                                                                                                                                CS3CallBack
                                                                                                                                            (from controlers)

                                                                                                                                                CSControler
                                                                                                                                            (from controlers)




          CS3TextField                                            CS3Button                                          AController                            BController
          (from component)                                     (from component)                                      (from controlers)                    (from controlers)




You must notice that the relationship between CS3Object and other CS3Component such
as CS3Button,CS3TextField,CS3TextArea is very important. This relation constitutes the
open standard for this framework. If you want to define your own component (JavaBeans)
according the function criterion of CS3Object the component can be applied in this
framework.
The design of event dispatcher adopts two main patterns: Bridge, Proxy. From the diagram
we can realize that through CS3Object’s instance of CS3CallBack form the bridge for
                                                                               Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                                Thought & Manual




CS3Component and Controller.
CS3CallBack is java Interface ,it has been declared following method to manage the
event :
1:AWT Event
2:Document Event
3:Table Model Event
4:Tree Selection Event
5:List Selection Event
6:Change Event
CS3CallBack is an instance of CS3Object,All GUI components include one CS3CallBack
instance

     public interface CSCallBack
     {
         public abstract void initCSCallBack();
         public abstract void callBack(AWTEvent awtevent, String s, String s1);
         public abstract void callBack(DocumentEvent documentevent, String s, String s1);
         public abstract void callBack(TableModelEvent tablemodelevent, String s, String s1);
         public abstract void callBack(TreeSelectionEvent selectionent, String s, String s1, String s2);
         public abstract void callBack(TreeExpansionEvent treeexpansionevent, String s, String s1);
         public abstract void callBack(AWTEvent awtevent, String s, String s1, int i, int j);
         public abstract void callBack(AWTEvent awtevent, String s, String s1, Object obj);
         public abstract void callBack(ChangeEvent changeevent, String s, String s1);
         public abstract boolean callBackInputVerifier(String s, String s1, String s2, int i);
         public abstract void callBackInvoke(String s);
         public abstract void callBack(HyperlinkEvent hyperlinkevent, String s, String s1);
     }




In CS3Object the instance of CSCallBack is a proxy of each function named
invokeProxyCallBack(), For different parameters CSCallBack will invoke the same function
named callBack with different parameters.




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




     public class CSObject {
     CSCallBack jcb;//Instance of CSCallback
     JComponent comp;//The proxy of CSComponent
     HashMap holderOfNodeProperty = new HashMap();//Store propertys
     String uniqueName="";//Distinguish different component
       void invokeProxyCallBack(AWTEvent awtevent, String s)
       {
          jcb.callBack(awtevent, s, parentId);
       }
       void invokeProxyCallBack(ChangeEvent changeevent, String s) {
          jcb.callBack(changeevent, s, parentId);
       }
       void invokeProxyCallBack(TreeSelectionEvent treeselectionevent, String s,String s1)
       {
          jcb.callBack(treeselectionevent, s, parentId, s1);
       }
       void invokeProxyCallBack(TreeExpansionEvent treeexpansionevent, String s)
       {
          jcb.callBack(treeexpansionevent, id, parentId);
       }
       void invokeProxyCallBack(DocumentEvent documentevent, String s)
       {
          jcb.callBack(documentevent, s, parentId);
       }
       public String generateSource(String parent, org.jdom.Element element)
       {
          return null;
       }
       public void setCallBack(CSCallBack jecallback)
       {
          jcb = jecallback;
       }
     }


When we define our own component we can extends CSObject

     public class CSButton extends CSObject implements MouseListener
     {
       JButton button;
       public CS3Button(String idIn)
      {
        this.id = idIn;
        button = new JButton();
        button.setActionCommand(id);
        button.addMouseListener(this);
        button.setFont(new Font("Dialog", 0, 12));
        button.addActionListener(new ActionListener()
         {
          public void actionPerformed(ActionEvent actionevent)
           {
             invokeProxyCallBack(actionevent, id);
           }
          });
        }
      }




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




4.1.4.2    CSControler

该类是所有的控制器的父类,也是事件处理的适配器类。只要实现相应的回调方法就会完成
相关的控制类。
在该类中实现了 CS3CallBack,所有的实现都是空实现,对于子类要覆盖父类的实现来进行
特定的处理。
参考示例代码:




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                               Thought & Manual




     public class CSControler implements CSCallBack
     {
       final protected int MOUSECLICKED = MouseEvent.MOUSE_CLICKED;
       final protected int KEYTYPED = KeyEvent.KEY_TYPED;
       final protected int FOCUSGAINED = FocusEvent.FOCUS_GAINED;
       final protected int ACTIONPERFORMED = ActionEvent.ACTION_PERFORMED;
       CSView baseView = null;
       public CSControler(CSView baseViewIn)
       {
         this.baseView = baseViewIn;
       }
       public CSView getView(CSView view)
       {
         return baseView;
       }
       public void setView(CSView view)
       {
         baseView = view;
       }
       public HashMap getHashMap()
       {
         return (this.baseView.getHashMap());
       }
       protected CSObject getCSObject(String objectID)
       {
         return (CSObject)this.getHashMap().get(objectID);
       }
       ..............................
       public void callBack(AWTEvent awtevent, String sCSObjectID, String sParentId)
       {
         try
         {
            CSObject taxObject = baseView.getCSObject(sCSObjectID);
            int iEventId = awtevent.getID();
            if (taxObject instanceof CSButton && (iEventId == ACTIONPERFORMED))
            {
              if ("BT_submit".equals(sCSObjectID))
              {
                 submit();
              }
              else
              {
                 process(awtevent, sCSObjectID, sParentId);
              }
            }
            else
            {
              process(awtevent, sCSObjectID, sParentId);
            }
         }
         catch (OperationException e)
         {}
       }
       public void process(AWTEvent awtevent, String sCSObjectID, String sParentId)
            throws OperationException {}
       public void callBack(DocumentEvent documentevent, String sCSObjectID,
                              String sParentId)
       {
         try
         {
            process(documentevent, sCSObjectID, sParentId);
         }
         catch (OperationException e)
         {}
       }
       public void process(DocumentEvent documentevent, String sCSObjectID,
                             String sParentId)
            throws OperationException{}
       public void initCSCallBack(){}
     }




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




4.1.5       Demo


4.1.5.1 Description of Demo




4.1.5.2 Sequence Diagram of Demo


4.1.5.3 View


4.1.5.4BaseInformationControler

5    Description of CS3 Manipulation
This section will lead you experience how to develop application using CS 3 software.
Via hard work I develop one software help developer to create GUI application conform to
Framework mentioned above. Through this software we can define GUI by dragging and
dropping components from toolbar .You can constitute one view via setting the property
with the help of property window, at any time you can preview the result. You can get
source code only enter into the source view. You can edit, compile, run any other java file in
the editor just like any other IDE
The main Interface of CS3software include followings:
            MenuBar
            ToolBar
            Project structure Window
            Property Designer
            Log Window:
            Workshop Designer
            Layout setting Window




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




5.1   Tools




5.1.1 Tool Bar
      Tools available:
         GUI Components: Adding of single components(Label, Button, Text Field, Text
          Area all swing component)

5.1.2 Menu Bar
      Tools available:
       Create New Project
       Create New File
       Create New View
       Edit file
       Run Application
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




          Compile Application

5.2   Project Structure
      Every project is made up of one or several models. Each model typically corresponds
      to one user interface. The first component that has been added to the model is always
      considered as root component of the GUI. Although every component class could be
      used as root, in general the best choice is a Panel or TabbedPane, which can later be
      used to build a dialog, frame or window. Projects are saved in XML format. Only
      properties changed by the user are saved.

5.2.1 Project Structure View




5.2.2 Directory diagram of CS3 project




This software have 8 directories in order to store different files.
1. Classes: Store class files have been compiled
2. Config: Store configuration of your own CS3 project
3. Dao: Store the source code of DAO generated automatically by this tool.
4. Docs: Store documentation generated by system
5. Ejb: Store the source code of EJB and some XML files generated automatically by this
   tool
6. GML: Store GML files you have defined
7. Lib: Store the lib file you want to use.
8. Src: Store source file you write in this IDE
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




There are two files named build.xml and Project.cs3p the first one define how to compile
source code via Ant tool, the other file defines the structure of your project.

5.2.3 File content of build




This file define how to compile source code. Refer Ant tool. This file’s content is generated
when the project created. No need to modify this file.

5.3   Workshop Designer

5.3.1 Model Window :




This window is the workshop for designing the view you wanted. Once you choose some
components from component palette and choose the container which you want placed, The
component you selected will be placed in container as default layout. The effect of designer


                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




is What you see is what you get. You can change layout property by defining layout
property window.
In the workshop you can choose which one component you modified, simultaneously
property window (Refer Component Property Window) will show you the properties, at the
same time model structure window will selected the component just like this view.

5.3.2 Model Structure Window:




This window displays the structure of your view. Component will showed as leaf node of
parent container. From the shortscreen’s structure we can know that the component named
component1 is a parent container of component named component2, and component2 is
parent container of component5~component13. Through this view we can manager the
relationship between different components.




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




5.3.3 Layout Property Window




5.3.4 Component Property Window
           In the component properties window you can change the properties you want to
            define.
           There three item for each property: Type, Name, Value. Type descript whether
            this property is node or attribute of GML. Name describes the name of GML node
            or GML attribute.
           Type property can’t be modified, what you want to define is value content just by
            typing some value you wanted. For example you can type “True” to define Node
            property of editable.
           Once you modify the value the workshop will repaint component in your view
            designer.




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




5.3.4.1Indexed Properties

           Indexed widget properties like title of class JTabbedPane are marked by
            appending square brackets [...] to the property name. After clicking the name
            column the displayed and editable index of the property may be changed.




5.3.4.2Simultaneous Setting of Properties of Several Widgets

           When several widgets are selected, the Widget Properties Window shows only
            properties common to all widgets. Changing the values of properties will have
            effect on all selected widgets. Example: Setting the border of three text fields

5.4   Layout Setting Window
Whenever Gridbaglayout is used as layout manager for a container and one of its child
component has been selected, the gridbag constraints can be set with this dialog:




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




The dialog shows attributes of class GridBagConstraints :

Position:
Attributes grid x and grid y, specifying grid cells of the component .The value of constant
GridBagConstraints. RELATIVE (-1) is also applicable. Furthermore, cell numbers may be
modified relatively to the current value. To accomplish this, a single r is placed before the
cell value. For example, to increase the value of gridy from 1 to 4, “r 3“ has to be entered.
Using relative values allows to move rows or columns of widgets for inserting new widgets.

Number of columns the component occupies:
Attributes gridwidth and gridheight . Values of constants

Set alignment style:
Attribute alignment. Place to anchor component.

Set padding style:
Attribute padding. Setting for adjusting component resizing.




In this software you can generate source code of your designed view. Once you select the
Code View after you have finished designing this software will show the source code you
have designed. You can also modify source code by source code editor. Just like the
followings


                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




6     Description of GML(Graphics Markup Language)

6.1    Root Node




     packagename: define the name of view,      controller,CMP Entity Bean, BMP Entity Bean
      and DAO
     classname: define the class name of view and controller
     calculationfile: define the calculate relation XML file name between the components
      (Refer calculate description)
     panel: define the container of GUI components



                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




6.2    Container
Due to Java GUI components are managed by container such as Panel,TabbedPane ,so
GML define the attribute of container. According to experience of project container are
classified three level.

 First Level Container

 Second Level Container

 Third Level Container

6.2.1 First Level Container




     Pane: JTabbedPane
     Constraints: North, Center, South and so on. Refer constraints
     Title: Define the title of TabbedPane;
     Icon: Define the icon file of TabbedPane;
     Border: Define whether this TabbedPane has border and the value of this property is
      the title of this pane;
     Sub Panel: Define whether this container has sub container, if true define the detail of
      sub container.
     Horizontal: Define this pane can be separated horizontally
     Vertical :Define this pane can be separated vertically

6.2.2 Second Level Container




The second level container is mainly panel :
 Row: Define the row number of this container if this container is component of another
   container with layout of GridBagLayout
 Constraints: Define how to place this component into one container. This property value
   can be North, South, Center or other like 0,0,1,1,17,1
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                             Thought & Manual




6.2.3 Third Level Container
Refer Second Level Container。

6.3    Explanation of Id and constraints attribute:
 id:The unique name of component
Since the components in view are managed by name ,so the id attribute must be defined in
each component, In order to access the component with more convenience we should
establish one rule for id the rule should be defined according to real situation of project
 constraints: define the layout property for CSGridbagPanel so as to manage the
    component placed in this container, because one function of CSGridbagPanel is
    addComponent(CSObject component,String constraints) the first parameter is the
    component placed in the CSGridbagPanel and the second parameter means how to
    layout this CSObject. The content of constraints property is displayed through String
    constitute 6 parts.
  1. row number: You may ignore this property, but in the default situation suggest you
      layout your components order by column number, If you want to add first component
      in new row you should define first part,。
  2. column number:
  3. column span:
  4. row span:
  5. alignment style:Default alignment style is west alignment.
  6. padding style:0 Means without padding,1 means horizontal padding, 2 means
      vertical padding, 3 means both horizontal and vertical.

6.4    Component:label:
       <CS3Label id="lbNsrmc" constraints="0,0,4,1,17,1">
          <text> Hello\n world</text>
          <font>KaiTi_GB2312,1,18</font>
          <horizontalAlignment>CENTER</horizontalAlignment>
       </CS3Label>
     CS3Label :Define Root Node name, CS3Label is the class real name of CS3label
     Font: Define the font of this component。
     Text: Define the display text in the button component, if your text has the mark of \n this
      label component will show text with some wrap text.
     horizontalAlignment: Define the alignment style of horizontal
     verticalAlignment: Define the alignment style of vertical.

6.5    Component:button:
       <CS3Button id="btClose" constraints="5,1,1,1,17,0">
          <text>Exit</text>
          <tooltip>Exit system</tooltip>

                                        Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                           Thought & Manual




          <font>Dialog,0,12</font>
       </CS3Button>
     CS3Button :Define Root Node name, CS3Button is the class real name of CS3Button
     Font: Define the font of this component。
     Text: Define the display text in the button component
     Tooltip: Define the tooltip of button component


6.6    Component:textField
       <CS3TextField id="tfNsrdm1" constraints="1,1,1,1,17,1">
          <editable>true</editable >
          <needInput>true</needInput>
          <length>20</length>
          <font>Dialog,0,12</font>
       </CS3TextField>
     CS3DateField :Define Root Node name of CS3TextField is the class real name of
      CS3TextField
     Editable: Define whether this component can be edited in runtime, if this value is true
      you can modify the content in runtime otherwise you cant change the content in this
      component
     NeedInput: Define whether this component’s content can be blank
     Font: Define the font of this component
     Length: Define the default size of this component.


6.7    Component:textArea
       <CS3TextArea id="taNsrdm1" constraints="1,1,1,2,17,1">
          <editable>true</editable >
          <needInput>true</needInput>
          <rows>2</rows>
          <linewrap>true</linewrap>
          <font>Dialog,0,12</font>
       </CS3TextArea>
     CS3TextArea :Define Root Node name of CS3TextArea is the class real name of
      CS3TextArea
     Editable: Define whether this component can be edited in runtime, if this value is true
      you can modify the content in runtime otherwise you cant change the content in this
      component
     NeedInput: Define whether this component’s content can be blank
     Font: Define the font of this component
     Rows: Define how many rows are showed in this components

6.8    Component:dateField
       <CS3DateField id="dfSbrq" constraints="1,2,1,1,17,1">
                                      Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                              Thought & Manual




          <editable>true</editable >
          <font>Dialog,0,12</font>
       </CS3DateField>
     CS3DateField :Define Root Node name of CS3TextField is the class real name of
      CS3TextField
     Editable: Define whether this component can be edited in runtime, if this value is true
      you can modify the content in runtime otherwise you cant change the content in this
      component
     NeedInput: Define whether this component’s content can be blank
     Font: Define the font of this component。

6.9    Component:comboBox
       <CS3ComboBox id="cbZclx" constraints="1,4,1,1,17,1">
          <font>Dialog,0,12</font>
          <element>item1</element>
          <element>item2</element>
          <element>item3</element>
       </CS3ComboBox>
     CS3ComboBox:Define root node name. CS3ComboBox is the class real name of
      CS3ComboBox
     Font: Define the font of this component。
     Element: Define the initial content of this component. If the contents are acquired from
      data model we can add one node of dada model then define the class name and
      method name through which class can fetch data. Just like following:
       <CS3ComboBox id="cbZclx" constraints="1,4,1,1,17,1">
          <font>Dialog,0,12</font>
          <datamodel classname="com.cssnet.CS3.components.utils.DataModelUtil" methodname="getComboData"/>
       </CS3ComboBox>


6.10 Component:radioButtons
       <panel row="4" id="paRadio" border="" constraints="3,1,1,17,1">
          <CS3RadioButton row="0" id="rbYes" constraints="0,1,1,17,1">
              <font>Dialog,0,12</font>
              <text>yes</text>
              <defaultSelected>true</defaultSelected>
          </CS3RadioButton>
          <CS3RadioButton row="0" id="rbNo" constraints="1,1,1,17,1">
              <font>Dialog,0,12</font>
              <text>no</text>
              <defaultSelected>false</defaultSelected>
          </CS3RadioButton>
       </panel>
     CS3RadioButton:Define root node name. CS3RadioButton is the class real name of
      CS3RadioButton, if we place some CS3RadioButtons in one panel ,these
                                         Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                             Thought & Manual




     CS3RadioButton compose one choose group.
    Font: Define the font of this component
    Text: Define the display text
    defaultSelected: Define whether this CS3RadioButton is default selected one. If true
     this component will be checked as true


6.11 Component:checkBox
       <CS3CheckBox row="0" id="chZjzs" constraints="0,1,1,17,0">
          <text>Your text here</text>
          <font>Dialog,0,12</font>
       </CS3CheckBox>
    CS3CheckBox:Define root node name. CS3CheckBox is the class real name of
     CS3CheckBox, if we place some CS3RadioButtons in one panel ,these CS3CheckBox
     compose one choose group.
    Font: Define the font of this component
    Text: Define the display text
    defaultSelected: Define whether this CS3RadioButton is default selected one. If true
     this component will be checked as true

6.12 Component:list
       <CS3List row="0" id="chZjzs" constraints="0,1,2,17,0">
          <visiblerows>2</visiblerows>
          <font>Dialog,0,12</font>
          <element>item1</element>
          <element>item2</element>
          <element>item3</element>
       </CS3List>
    CS3List:Define root node name. CS3List is the class real name of CS3List
    Font: Define the font of this component。
    Visiblerows: Define how many rows can be showed in this list component
    Element: Define the initial content of this component. If the contents are acquired from
     data model we can add one node of dada model then define the class name and
     method name through which class can fetch data. Just like following:
       <CS3List row="0" id="chZjzs" constraints="0,1,2,17,0">
          <visiblerows>2</visiblerows>
          <datamodel classname="com.cssnet.CS3.components.utils.DataModelUtil" methodname="getListData"/>
       </CS3List>


6.13 Component:tree
       <CS3Tree row="0" id="chZjzs" constraints="0,1,2,17,0">
          <visiblerows>2</visiblerows>
          <editable>false</editable >
          <font>Dialog,0,12</font>
                                        Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




          <element>item1</element>
          <element>item2</element>
          <element>item3</element>
       </CS3Tree>
    CS3Tree:Define root node name. CS3Tree is the class real name of CS3Tree
    Font: Define the font of this component。
    Visiblerows: Define how many rows can be showed in this list component
    Element: Define the initial content of this component. If the contents are acquired from
     data model we can add one node of dada model then define the class name and
     method name through which class can fetch data. Just like following:

       <CS3Tree row="0" id="chZjzs" constraints="0,1,2,17,0">
          <visiblerows>2</visiblerows>
          <datamodel classname="com.cssnet.CS3.components.utils.DataModelUtil" methodname="getTreeData"/>
       </CS3Tree>


6.14 Component:tables:
节点名 CS3Table 对应实际的类名,代表表格; column 代表表格的一列;title 代表该列的标
题;建议将 table 置于 panel 内;其余子元素暂不处理。计算关系定义
在 根 节 点 中 指 定 的 calculationfile 属 性 为 计 算 关 系 的 xml 定 义 文 件 , 例 如 :
f1=f2+f3-(f4-f5*f6*2.5)+f7/f8 和 f9=f1-100 的计算关系定义方法




下面是对其详细说明:
                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




1 节点有四个属性 name(字段名)、opr(操作符)、scale(小数位数)、value(节点值),可以根据具
体情况取舍和置空值
2 第一级节点必须有 name,表示通过其子节点计算出来的值需要赋给界面 name 域
3 opr 支持+、-、*、/(除)、%(取余),对于括号所界定的计算顺序可以通过子节点的定义实现
4 对于/(除)操作,scale 默认为 2,其他的操作的 scale 的默认值是无限制的,可以设定 scale
值确定操作的小数位数
5 value 值只是对于节点是常量时起作用

7     Scenario

7.1    Demo code of GML
      Refer:QysdsView.xml
      Refer:CalculateRalation.xml

7.2    Demo code of java file generated by CS3
      Refer:SBqysdsVIEW.java

7.3    Demo code of calculate relation generated by CS3
      Refer:SBqysdsVIEWCalcRela.java

8     Success Case
      《广东地税大集中核心征管系统》

8.1    Background of Case
   广东地税税收收入在全国排名连续 8 年位居首位,系全国税收大省。在这样的税收大省,
业务涉及面广,缴税量大,要实现广东地税税务征管系统的全省应用和数据的集中,必须要
有成熟可靠的技术支撑体系,开发出新一代税收征管信息系统,其标准高、难度大、任务重,
这在国内税务领域信息化建设中尚属首创。实现省级税务征管系统应用和数据的大集中,必
须要有成熟可靠的技术支撑体系,选择正确的技术路线是关键。本项目启动之前,广东地税
聘请了国际知名的普华永道顾问咨询公司                        ,
                                (现已并入 IBM) 历经 5 个月的时间,完成了业务、
技术和实施的论证规划,           同时聘请国内外的知名公司包括 IBM 公司和专家对规划报告进行充
分的论证。对于技术路线的选择,邀请了世界上著名的 10 家 IT 公司进行了拆分的论证规划,
最后统一推荐使用纯 J2EE 三层架构来实施新一代税收征管信息系统。纯 J2EE 体系架构来完
成大数据量、高并发、实施性极强的事务处理系统,在国内外成功案例非常少。没有可以参
考的案例,全新的体系架构是本项目的一个重大挑战。
   该系统基于 J2EE 体系进行架构,后台系统采用 Weblogic8.1 为业务服务器,客户端主要
由 Browser 和 GUI Application 两种方式,其中大部分业务要求响应速度快,业务处理集中,
数据来源多样这是 Browser 不能胜任的,因此 70%的业务都是由 Application 完成的。
   由于税务部门业务复杂,界面数量大。整个业务系统共有 700 多个界面,而且各个界面
有着很强的相互关联性,使得各个界面间的交互不能单独完成,这样采用传统的 JAVA 开发
工具无法胜任,而且传统的开发得出的结果不能形成一种统一的架构,不同人员开发出来的
界面风格必然会存在着很大的差别。而对于这样的项目要求正好是此框架以及开发软件的强

                                       Client Server Software & Service( CS3)
Client Server Service &Software(CS3)                                            Thought & Manual




项,因此此系统全部采用了该讨技术方案。该框架在此项目中已经获得了很大的成功。系统
在需求分析结束以后就进入到界面原型的开发过程,而这个过程仅用了一周的时间投入了 8
个人就提前完成了界面原型的所有部分,这比用其它的技术方案提高了近 50%的事件,而所
有的界面原型构建出来的界面部署描述符在系统编码过程中直接转化成为 JAVA 源文件,这
时程序人员只是通过描述符中的命名来实现业务的控制类的编写。仅通过这个源文件生成的
过程就为项目节省了近 150%的时间,由此可知该框架以及该解决方案对于大型的界面开发
的项目中起到的关键作用。

9     Contact

9.1    Contact Information

      Email :songnaihui@sohu.com

      Cell Phone:8610-13810301888

      Address :Beijing China




                                       Client Server Software & Service( CS3)
Beijing China




                                       Client Server Software & Service( CS3)

								
To top