Introduction to Hibernate

12/14/10
Posted by Fulto

we can use the techlologies like JDO( Java Data Object) , Hibernate , toplink etc for accessing the databases.
All these technologies internally uses JDBC API.
A developer can save lot of time during the development by using Hibernate/JDO/TOPLINK etc.. instead of directly making use of JDBC API.
Hibernate called as Object Relational Mapping Technologies (ORM Technologies).

The data that is stored in the database tables managed by the RDBMS Servers is called as "Realtional Data".
To use Hibernate we must provide the files called as "hbm" files (Hibernate Mapping Files).In that "hbm" files we must provide the following details.
1) The mapping between the database table and the java class.
2) The mapping between the columns of a database table and the properties of the java class that is mapped to the table.
package org.myfulto;
public class Employee
{
private Long empNo;
private String empName;
private String address;
private Float salary;
// setters and getters supporting the follwoing properties
//empNo, empName, salary and address.
public void setEmpNo(Long empno)
{
this.empNo=empno;
}
public String getEmpNo()
{
return this.empNo;
}

public void setEmpName(String empName)
{
this.empName=empName;
}

public  String getEmpName()
{
return this.empName;
}
public void setaddress(String addr)
{
this.address=addr;
}

}

Labels:

Ckecking the avalability of company name

12/8/10
Posted by Fulto

http://www.mca.gov.in/DCAPortalWeb/dca/CompanyNameSRAction.do

usefule site for registering new software company in India

Posted by Fulto

http://kumaran.wordpress.com/2006/09/06/procedure-involved-to-start-a-company-private-limited-in-india/

Useful sites for Java Based MiniProjects and aminProjects

Posted by Fulto

The following are the very useful sites for downloading JAVA BASED MINI PROJECTS AND MAIN PROJECTS.

http://mindprod.com/project/projects.html


http://1000projects.com/

Introduction to Struts Framework

12/3/10
Posted by Fulto

 Struts Framework is collection of utility classes for doing integrating logic.
It provides readymade classes for avoiding manual work while developing huge web applications.
Struts framework was developed by Apache Software Foundation.

Labels:

Data Transfer Object Pattern

Posted by Fulto

Data Transfer Object Pattern is used for transfer the data elements from one tier to another tier.

Labels:

What is the use of DAO( Data Access Object)

Posted by Fulto

DAO pattern is uesd for connecting with the backend softwares like DBMS and FILE SYSTEMS.
The follwoing are the Sample code for creating DAO.
<pre class="java" name="code">
public interface EmpDAO
{
 void createEmp();
Employee getEmpByID(int id);
List getEmpsByDepartment(int did);
}
</pre>

We need to implement the above interface(EmpDAO).
The follwoing is the implementation class for Oracle Data Base.
<pre class="java" name="code">
public class ImpOracleEmp implemnets EmpDAO
{
/* write the code for implementing methods that are specific to Oracle  Data Base */

}
</pre>

The follwoing is the implementation class for XML.
 <pre class="java" name="code">
public class ImpXMLEmp implemnets EmpDAO
{
/* write the code for implementing methods that are specific to XML*/

}
</pre>

Labels:

Flow of Model View Controller architecture

12/2/10
Posted by Fulto



MVC Architecture   provides the easiness for developing web applications by separating business logic and display logic.
MVC architecture have main three components that are
1) Model 
2) View
3) Controller

Model:    Model component specifies the business logic and data of web applications.
                              Business logic includes storing, updating of data into relational databases.
View:
                  View Component represents the display logic of output which will sent to the client.
                               In this view developer never worried about the business logic.

Controller:  Controller Component specifies the flow of requests of applications.

The following figure shows the communications between model, view and controller components.


The following are the steps in the above figure:

  1. A browser request is submitted to and handled by the Action Servlet class, which has one physical instance per server.
  2. The Action Servlet calls the Request Processor to prepare the request and response objects, determine action mapping etc.
  3. The Request Processor creates (or re-uses) the corresponding Action Form bean, populates it with the input fields from the html form and invokes form validation (if required).
  4. Using the action mapping in its config file, the Request Processor passes control to the appropriate Action Class. The Struts framework pools instances of Action classes; therefore, if the action has already been requested, it will be retrieved from the instance pool, as opposed to being created with every request. However, without multi-threading, this can lead to significant collisions when multiple users are accessing the same action.
  5. The Action Class invokes business logic beans and passes the Action Form (or a portion of it) to the model. The model may be EJB-based, or consist of plain Java objects.
  6. After the action completes execution, it is returned as an Action Forward object which determines the target of the request.
  7. Control is finally returned to the Request Processor, which forwards the request to the appropriate target.
  8. The JSP page may get data from the Model through a set of tag libraries.




What is the use of Design Patterns in The Designing of Sttruts Aplications?

Posted by Fulto


To develop complicated applications we can use Struts frame work of Apache.
M-V-C II architecture is used in Struts applications.
To develop Struts based applications we need know about the Design patterns.
Definition of Design Patterns: 

Design pattern is a tree-part rule for express a relation between a certain context, a problem and a solution.
The following are useful design patterns in the designing of Struts based web applications.
1) Front Controller Design Patterns
2) Application Controller
3) Data Access object (DAO)
4) Data Transaction Object (DTO)

Labels: