Saturday, June 4, 2011
Brief uses and advantages of java.util.Arrays
Hi Folks,
In this post i want to introduce you guys about one common utility class that is very helpful in sorting and searching of values in an array of any type like int,long,String etc. Simply we can state it as java.util.Arrays which is very useful in manipulating arrays such as searching,sorting and viewing all values as a list at a time without any iteration etc.
This class contains various methods to manipulate arrays of any type. For example, you have an array of string values like below
String s[] = {"hi", "ramu", "cris"};
and you want to sort these values then you don't need to write/implement any sorting algorithm instead you can simply use statement
Arrays.sort(s[]);
to sort those values. This java.util.Arrays.sort(Object[] a) method is useful to sort array of objects. Here our s[] is String type of object so we can simply use this method to sort our array.
If you want to print all the values using at a time then also you don'e need to iterate instead you can use
System.out.println(Arrays.asList(s[]);
This method java.util.Arrays.asList(T... a) is used to back the values to a List.
Like these there are many more methods by which you can easily manipulate arrays.
Thursday, May 19, 2011
Hibernate With Examples: Hibernate Hello World Program
In this post i want to give some reference which is intuitive for beginners.
Hibernate With Examples: Hibernate Hello World Program
Friday, March 19, 2010
Brief About InvalidClassException in Java
Hi Folks,
How are you all? Today i have a got an error below which stop me to work for a couple of hours
Unable to de-serialize job. Blah.... local class incompatible: stream classdesc serialVersionUID = -9148880418277643823, local class serialVersionUID = 2323422343
java.io.InvalidClassException: ClassName local class incompatible: stream classdesc serialVersionUID = -9148880418277643823, local class serialVersionUID = 2323422343
I thought most of the folks facing this error some time and start searching google for solution. Then i also thought i share a light of my work around here.
Generally InvalidClassException comes when your class implements Serializable interface and you didn't mention serialVersionUID field in your class. If your class doen't contain this field when ever your class compiles, compiler generates a unique id like roll no which causes conflicts with old one results exception.
To avoid this problem, solution is very simple. You need to enter below field in your class when it extends Serializable interface.
public static final long serialVersionUID = 34354354435l;
This small filed eliminates problem causing InvalidClassException
When you are programming your java code in Eclipse then you get a warning like "The serializable class FlattenAllWorkingSetsJob does not declare a static final serialVersionUID field
of type long" this. If you try to eliminate that warning that automatically resolves problem of causing InvalidClassException
Saturday, December 27, 2008
Important Links For Technical
You can just know brief explanation about lisp language by the below link:
http://girnartech.blogspot.com/2008/12/lisp-tutorial-1.html
You can just know how to format pen drive in ubuntu using the below link:
http://girnartech.blogspot.com/2008/12/how-format-pen-drive-in-ubuntu.html
You can know how to install ftp server in ubuntu which will be useful for every one to connect to your system and make your system as server using the below link
http://girnartech.blogspot.com/2008/12/installing-ftp-server-in-ubuntu.html
Saturday, November 8, 2008
Part2-MVC Layer
Business Logic:
Business logic mainly describes actual logic of your software going to impliment. It means for example if you want to design a desktop search software using java then for it business logic is as follows:
- First you need to manipulate the incoming data from the database ,in that you need to develop some logic .
- To make another developer's way to read your logic very easily business logic helps very most.
Tuesday, August 5, 2008
MVC model for doing software projects
MVC MODEL
In general any software Industry want to do projects in mvc architecture.But what it actually
is Model View Controller architecture.In this you find three new words,here below i am explaining clearly about those terms.
Data Access Layer means it is the layer which contains methods to access data from DataBase. It has the direct access to database(i.e. inserting data into database,updating data in the database,retrieving data from database etc.).For this generally we use "Beans" which contain the required feilds,their Getters and Setters. SPRINGS is one of the technologies used to write logic of Data Access Layer.
GUI means graphical user interface which containls the actual LOOK and FEEL of your project.It contains the UI screens with which user can avail the services of your project.For example you want to search for some article in google then you need some interface to enter your idea to be searched that is what ,which attracts people to click Your site after that only. you need is it working perfectly or not? So GUI is very important for any project.There are several technologies to write the logic of GUI.In that some of them are JSP,HTML etc.
Controller is the one which controlls all actions ,works of your project.It manages the whole layers of your project.From the starting i.e. accessing the details entered by user to accessing the database(i.e. inserting ,deleting,updating,retrieving etc.)In contrller Action Servelet is one which intializes the running of your project.
The following diagram gives you some description about this model.

In general any software Industry want to do projects in mvc architecture.But what it actually
is Model View Controller architecture.In this you find three new words,here below i am explaining clearly about those terms.
- Model means Buisyness Logic .It includes actual logic in working project. This adds meaning to raw
data.(Ex: calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items).
- View means GUI(Graphical User Interface) in your project i.e. what you are giving user to interact with your project.(Ex: yahoo login page in yahoo website,searching text field in google website etc.)These includes JSP(java server pages),HTML pages,etc.
- Controller means Action Servelets for controlling your whole project from one part to another part.Using this controller anyone's project will run from initial user interaction to storing details into database(if needs).(Ex: In yahoo site user enters his details ,this controller will take that details and forward to action,from action to form,from form to service,from service to DAO(Data Access Object) etc.) You will clearly know about these highlited terms below.
Data Access Layer means it is the layer which contains methods to access data from DataBase. It has the direct access to database(i.e. inserting data into database,updating data in the database,retrieving data from database etc.).For this generally we use "Beans" which contain the required feilds,their Getters and Setters. SPRINGS is one of the technologies used to write logic of Data Access Layer.
GUI means graphical user interface which containls the actual LOOK and FEEL of your project.It contains the UI screens with which user can avail the services of your project.For example you want to search for some article in google then you need some interface to enter your idea to be searched that is what ,which attracts people to click Your site after that only. you need is it working perfectly or not? So GUI is very important for any project.There are several technologies to write the logic of GUI.In that some of them are JSP,HTML etc.
Controller is the one which controlls all actions ,works of your project.It manages the whole layers of your project.From the starting i.e. accessing the details entered by user to accessing the database(i.e. inserting ,deleting,updating,retrieving etc.)In contrller Action Servelet is one which intializes the running of your project.
The following diagram gives you some description about this model.

Labels:
action,
action servelets,
bean,
buisyness logic,
controller,
form,
gui,
html,
jsp,
model,
service,
view
Subscribe to:
Posts (Atom)