leo fisher

Greenhorn
+ Follow
since Nov 30, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by leo fisher

J2EE and Service Oriented Programming


Authored by: AmirSam Bahador
Level:
Advanced
Contents:
Introduction
- The purpose of compilation this essay

Chapter 1: Basic concepts of J2EE
- Servlet and JSP
- MVC
- MVC or JWMS? That is the problem? Perhaps both!

Chapter 2: Basic concepts of Shine Framework
- What is "Shine Framework�?
- The components of Shine Framework
- Implimentation of an application by Shine Framework

Chapter 3: The objects of Shine Framework
- The types of objects in Shine Framework

Chapter 4: Engineering & Communication items
- The communication of Shine Framework with the other
existing Frameworks
- The major purpose of Shine Framework


Introduction
The purpose of compilation of the this paper
A few years ago, when I was the software architect of a big project with J2EE, I advised some of the modern tools of that time to the project manager. He acknowledged it. Therefore, we began deploying our Enterprise on Java platform. However, we encounterd with many problems, as we got ahead the project. Our tools were included Struts Framework, Spring Framework & Hibernate.

I convinced that MVC architecture is the best option to develop macro projects! However, I believe it now, as well. Couldn't it be more completed? In developed Enterprise projects, an advanced architecture is required to divide the project, technically. The project was successfully finished after one year, but my mind was busy with it for a long time!

Then, I began implementing an Application Framework and registered it in Sourceforge.net as an Open Source Framework. I developed some Enterprise projects & some other J2EE frameworks, as well. I achieved a good result! The velocity of implemention & developing projects increased up to 50%. Subsequently, by cooperation of my elected students who had worked with Application Framework, I established an organization, named J2SOS, to protect & develop this Application Framework.
Fortunately, my students were so skilled that each took a chief task in big J2EE projects.
Their experiences had a practical affect on development of Application Framework as well as the organization.
Therefore, it is required to write down my & my yesterday students (my today co-workers) experiences. This was the outset to write the present paper!





Chapter 1
The basic concepts of J2EE
Purposes
In this chapter, we do our best to introduce J2EE basic concepts.
Servlet & JSP
If you ahve ever worked with JSP & Servlet, you know that Servlet is so proper for processing functions but there are particular problems with it in displaying functions.

JSP is applied reverse to Servlet. Thus, what is the solution? To apply both JSP and Servlet together!

What is MVC?
MVC is an easy way to use JSP & Servlet together. In MVC architecture, the request will be processed by a Class (Servlet) and the appropriate response will be showen by JSP.

See Figure 1-1


Figure 1-1

In the above Servlet Class, the validation operation, etc will be done.

Nowadays, there are numerous Frameworks which will assist you to use MVC Framework architecture. Struts Framework is the most well-known one.
MVC or JWMS ? That is the problem! Perhaps both!

MVC is a powerful architecture, but it is required an advanced architecture to implement developed projects.
Today, web applications are well developed which complicatethe work for programmers & developers.
To clarify it, see Google site! Google Web Application enjoys numerous services, each have a special service for the users.
For Instance, Gmail service, E-Mail or by SearchEngine, the users can search for websites, pictures, etc.

These services have certaily close communication with each other.
If the services do not use a particular architecture, the Google will encounter with various problems.
In Service Oriented architecture, each part of the program is a service programme. For example, E-Mail service, SearchEngine service, etc.

Consider Electeronic-Goverment application. This application does numerous services; each can be regarded as a separate application.


Figure 1-2

However, there is a problem! These applications should have communication with each other, i.e., a communication which is not a simple messaging one! I propose JWMS architecture to solve this problem!
Java Web Model Service (JWMS) transforms each part of E-Government application to a service. For instance, E-Bank service, E-Ministry service, etc.

See Figure 1-3

Figure 1-3

As you see, the request of user is transfered to Model via Web, it is processed by the Model t and the user is directed to the proper Service.
Model means a Servlet which processes the Request of the user.
It is likely that, in the first outlook, this architecture looks like MVC. Wait! You are not familiar with its internal components, yet!
To understand it obviously, you should be familiar with a Framework.

J2EE Service Oriented Programming
In

Framework

Chapter 2
Basic concepts of Shine Application Framework

Purposes

The purpose of this chapter is to introduce you Shine Application Framework.
What is Shine Application Framework?
Shine Application Framework is a Service Oriented Framework which assists you to implement applications in accordance with MVC & JWMS architedtures.
The components of Shine Framework
In applications which impliment by Shine, the request is first processed by the Model and the user is directed to the proper Service.

The Class that acts as Model is called Mapping. Mapping Class is similar to a servlet.

Each Mapping Class should extend �j2sos.shine.controller.Mapping� Class & implement �public void rater()� method.

Each service includes a JSP or a JSF page or � in which there are a succession of Shine�s rules and its exclusive tags.


See Figure 2-1:

Figure 2-1

Let�s review exclusively the components of the application which have been implemented by Shine.

See Figure 2-2:



Figure 2-2


The request is processed when it inserts the Mapping Class which spacifies the appropriate service for the user�s request and directs the user toward the service by web.xml file.
Implimentation of an application by Shine Framework
Make a web application as below:



Then apply �shine.jar� file to your library.
After adding the mentioned library, change �web.xml� file as follow:


Now, let�s analyze this file.
- �Description� tag indicates the name of application.
- �Servlet-name� & �servlet-class� tags show the name & address of �Mapping� class.

- �Init-param� tag and �ServerConsoleStatus� property & its �true� value notify Shine that the descriptions of the request should be displayed in Server side

This property will help you to get information about the requests via text environment of ApplicationServer. This property will certainly remind you of �showsql� in �Hibernate�.

- �Init-param� tag & its �Content-Type� property indicate the type of the contents of the response.
- "Init-param" tag & "servicename1", "servicename2" properties identify two services to Shine as well as specify the address of each service on the same server or the other one in Shine.
- "Servlet-mapping" tag indicates a name to attain "Mapping" class to the requests.
- The address of the library of Shine is identified to the ApplicationServer by "Taglib" tag.

Getting to know setting of Shine's properties in "web.xml" file, you should put "shine.tld" file beside "web.xml" file.

At present, � properties� setting of �web.xml� file is finished & we should consider the �Mapping� classes.

All of �Mapping� classes should be extended �j2sos.shine.controller.Mapping� class and implement �public void rater()� method.

For instance, let�s impliment �view.MyMapping� class.



As you see, this class enjoyes a method named �rater�. When the request inserts the �MyMapping� class, It will automatically be called.

This method is responsible for the first processes on the requests.

It is obvious that another method has been called in this method.

�Forward� method lead the user to the proper service. In this example, the user will be directed to �servicename2� service.

The value of �tag1� will be further explained next.

It is noted that you can call �forward� method by the other methods.



As it is previously mentioned, �servicename1� & �servicename2� indicate the address of two JSP pages which perform as a service.

Let�s implement one of these services (JSP pages).

Since �servicename2� is utilized in the previous example, we implement �service2.jsp� now. First �web.xml� should be reviewed.



Iimplement a JSP page initially named �service2� with the following contents:


In the beginning of the above page, the library of ApplicationServer is identified.

This page (Service) includes four principal tags.

�header� & �footer� tags act as the same as header & footer of text pages.

The values of �tag1� & �tag2� perform as two pages. When you call �forward� method in �MyMapping� class as below:

Forward (�servicename2�,�tag1�);

The user will be directed to �service2.jsp� as well as �tag1� will be displayed alongwith header & footer.

This is Shine Application !
Hello , this is service 2 and tag 1
J2SOS Organization

Now, if you call �forward� method in �MyMapping� class as below:

Forward (�servicename2�,�tag2�);

The user will be directed to �service2.jsp� and �tag2� will be displayed alongwith header & footer.

This is Shine Application !
Hello , this is service 2 and tag 2
J2SOS Organization

This type of coding in these pages lead to data sorting. In these pages, you can get values once via JSP and use it in all tags.



In fact, in this architecture, JSP pages act as �Service� & tags are considered as your �pages�.

Now, let�s impliment �service1.jsp� page.


To direct user to this service, it is merely required to call �forward� method as below:

Forward (�servicename1�,�tag1�);

To get the address of JSP pages & setting them in �web.xml� file, each page is directly run directly, then its address is indicated in �web.xml� file.



In these pages, reverse to Struts, you can use objects of request, response, etc in JSP since URL values are sent to JSP pages (Services) by �Mapping� classes send to.

Being acquainted with �Mapping� classes & �Service� pages, you should be able to send the request of user to �Mapping� class.

Therefore, It is required to set the value of the Action of HTML forms on your Mapping classes.


It is observed that this form bears a text field called �name� and the value of its action has been set on �MyMapping� class.
Now, let�s survey on sending request by Ajax! In this example, you should put �ajax.js� & �md5.js� files beside the request page.



As you can see, this form have a name. its information is sent to �MyMapping� class via �ajaxSubmit� method.
The value of �flase� in �ajaxSubmit� method causes the user not to communication with the request page till receiving the response.

�AjaxLoad� method will automatically be called when the form is sent. While the response is received, �ajaxResponse� method will be called, as well.

The value of �content� value includes the response of �MyMapping� class.

You can use �ajaxMD5Submit� method instead of �ajaxSubmit� one to send the information of form in MD5 format to �MyMapping� class.

�ajaxEternalSend� method acts similar �ajaxSubmit� method but it sends an URL and receives response, constantly. For instance:

ajaxEternalSend(�MyMapping.exec?name=��ali�,false,4);

In this method, the number �4� indicates a time scale to send URL to the �MyMapping.exec� class again.

Some other methods are determined in �component.js� file to help you in communication with java.


Chapter 3

The objects of Shine Framework

Purposes

In this chapter, the objects of Shine framework will be discussed.

The types of objects of Shine framework
As you know we have not achieved a parameter in mapping classes yet, therefore, 3 methods are used in these classes as follows;
- getRequest() method acts similar to request object in JSP.
To get parameter from URL, it is required perform as bellows;

getRequest().getParameter(�ParameterName�);

getConfig() and getResponse() method are applied the same as getRequest() too.


j2sos.shine.script.Server class help you work with server operating system API. If you intend to install a web based operating system, you can use this class.
The followings are the methods of this class:



To work with each method, you should make an object from this class.
Herein, the above methods are described.

Write() and writln() methods create a text on textual consul of Application Server.

getFileValue() method receives a directory and afile name, then return the contents of textual file.

writeFile() method receives a directory, a file name as well as file contents and makes a file in server.

createFolder() method recieves a directory and a file name to create a folder in server.

deleteFolderAndFile() method deletes a file or folder in server.

getCurrentDate() method sends back server's local time .

shutDownApplication() method stops the executing application.

j2sos.shine.script.CompietionRequest class helps you to receive parameters from URL. The followings are the methods of this class:



getUserid() method sends back identify number of the user session.

getRequestCounter() method makes a general counter and recieves a value for indicating the step of counter.
The other methods of this class perform similar to request.getParameter("ParamName") command, except they help you in casting and validation.
For instance, getStrParam("name","it is null") method leads the value of name to be sent back from URL, if this value is not available in URL, "it is null" value is returned.
j2sos.shine.monitor.ServerConsole class bears a method named showSeverConsole, which receives an object of request and displays the descriptions of request by application server console.
j2sos.shine.socket.ResponseService class have a method named getTagText, which receives an URL and tag name, then returns the contents of tag.


Chapter 4
Engineering and communication items

Purposes

In this chapter, you are acquainted with engineering and communication items.

The communication of Shine Framework with other existing Frameworks

As you now, the communication of a framework with other frameworks is extremely important.
You can communicate with other frameworks in shine.
These frameworks include as follows:
Hibernate
Spring
Struts
Or even Jsf, I am sure you have idea in this regard.
I try my best to put some of frameworks beside shine.
You can have several methods in mapping classes, for instance:


In this class, it is first received PageName value from URL.
Next, regarding PageName value, the service which should respond the request, will be identified.
If the insert value is p, p1Validation() method will be called.
If the input value is p2, p2Validation() method will be called.
If it is not input any P1 & P2 values, the user will be directed to errorservice and the value of notexisturl tag will be displayed.
If it is not input any P1 & P2 values, the user will be directed to errorservice and the contents of URL tag will be displayed.
If the developer makes an Exception, the user will be directed to errorservice and the contents of exp will be displayed.
Suppose we made an aspect file and programming it as before running each of methods(P1Validation, P2Validation), the other method is called.
Therefore, you will create a powerful management in mapping2 class.
Now, let's combine struts and shine together. It is required to use struts tags in your own service tags. For instance:



As you see, you can easily communicate with other existing frameworks in shine.
Ther have been published numerous papers about SHINE and JDBC , etc. See the following websites:
www.j2sos.org or www.sourceforge.net .

The major purpose of Shine framework

The main purpose of shine framework is implementing service oriented applications. In this framework, the developer is focused on implementing services.
This framework includes java web model service (JWMS) and MVC , which provides a particular system in implementing enormous applications.



J2SOS Organization Web Site: http://www.J2SOS.org
Shine Java Application Framework in Sourceforge.net: http://sourceforge.net/project/shine-app
15 years ago
every one have an Idea, but I know that when exist better j2ee framework than spring , you must learn it and replace it isted of spring.

in my Idea struts is better than spring because of its Architecture and validation is more powerful than spring,struts,....

I 'm a java architecture and deploy several project with struts, but when I accustom with shine framework and deploy several sample project with it, I understand that I find my favorite j2ee framework.but in that time I can not deploy my project with it(because of it have more risk).

but after learning shine an get a medium project that deployed by shine framework,than shine's support team, I decided to deploy a normal project with shine for myself.

when I deploy it,I was very happy and enjoy than my result.It had given me this ability that to deploy my project very strong and simpl than struts.

so:
when I find a powerful j2ee framework that is better than my framework(struts), I decide to use it(shine framework) insted of struts.

I think when someone have two chooses between the better and the best, it is more reasonable to choose THE BEST.

I have some evidence for this claim that shine framework is better:

shine is a service oriented framework.
shine have an special library for working with Ajax powerful and easy.
shine framework support MVC Architecture,but shine have special Architecture for himself to name JWMS(java web model service). Jwms is a complex than MVC Architecture and JWMS`s special Architecture for deployin web application in service level.

shine framework is a complex than other J2EE framework`s abilitys + shine`s very powerful abilitys. in shine framework,developers can use other j2ee framework`s source code after shine`s service(it mean they can use these codes in tags).

shine framework, rid developers than work with several response page,by him service oriented Architecture. in shine framework, we have services and in any service you have several tags,that any tags is as a response page. this ability of shine framework will interest for those developers that deploy big application with many response pages.

and the best point about shine is: DESPITE of shine framework is very powerful framework,shine`s usage is very simple.

NOW YOU JUDE, WHICH FRAMEWORK SHOULD BE YOUR CHOOSE? JSF,SPRING,STRUTS,... OR SHINE FRAMEWORK?
[ December 18, 2008: Message edited by: leo fisher ]
15 years ago
move over struts and other j2ee frame work,shine framework is become.

Empire of Shine frame work

Hello! I'm leo fisher,java Architecture.
A few days ago, I encounter a new Java frame work named Shine.
I read it's getting started document and that motivated me to test it.
I really enjoyed it, when I worked with it more!
The Shine's Developer had written some documents about it, in Sourceforge.net & J2sos.org. The documents said that Shine:

1. Is a full java service oriented frame work.
2. Is a JWMS (Java Web Model Service architecture) frame work for web base projects.
3. Includes Ajax, MVC, Service Oriented Scope.

So I tried to implement a simple sample in order to know it better. I found out that shine has a different view point about Service & to be Service oriented, that was very interesting for me!

Shine has deployed on JWMS architecture that is exclusive to itself. Furthermore it supports MVC architecture too.

As another advantage, Shine doesn't have the complexity of the other frameworks (for example FormBean component in Struts, �) and let developers to work with a very strong but simple operational process.

The other advantage is full Ajax supporting of Shine.
The simplicity but the power of Shine's validation is one of its advantages too.

After working with Shine a little more, I realize something interesting in it. In addition to the Shines Special capability which I said, it has complex capabilities of Tapestry, Struts, Servlet, Jsp & � .

I had developed some big java application projects. And as a professional developer I think Shine has some disadvantages, too. Shine is at its first version & doesn't have enough documents, Also it isn't experienced by developers.
So it isn't reliable enough to develop the projects with it.
And this is the reasons that don�t let me to deploy a real project with it.

Time will show us, whether shine is so strong to show itself as a powerful framework among the others or not?!

I don�t know, maybe Shine has some other advantages or disadvantages too. I really hope to learn about it more & will be glad if you let me know about your experiences touching Shine framework.

you can find shine in source forje in this link:
http://sourceforge.net/projects/shine-app/
or go to www.j2sos.org

be cool and good luck.
15 years ago