Tag Archive | "Part"

What Does a Managed Hosting Package Offer – Part 1


What Does a Managed Hosting Package Offer – Part 1

Article by Stuart Mitchell

For whatsoever individual or business looking to set up or move the hosting of their website or IT infrastructure, the number of different options facing them and the jargon used by each hosting provider, tin looking bewildering. The idea of managed hosting crops up frequently across the market but unfortunately it has no recognised industry definition. It is therefore worth taking some time to consider what the term has come to represent amongst hosting providers.

In general the called Managed Hosting designates a hosting package where the provider will offer a certain level of assistance with the set up and maintenance of your website’s or business’s server(s). In practice, because there is no industry standard for the term, the level and nature of the support you receive will vary from one provider to another. It is also common for providers to soliciting differing scales of support within different managed hosting packages.

Managed Hosting Services

However, full managed hosting will benefit you, as the client, with the expertise of the hosting provider to ensure that the set up and configuration of your website best meets your objectives whilst providing optimum performance. The services offered can typically include the installation and maintenance of software and operating systems, antivirus and security monitoring, performance monitoring and improvement (including load balancing) and DNS configuration amongst other things.

Support

Moreover, a managed package will likely include 24/7/365 monitoring and support (usually ‘human’ telephone support) so that, in worst case scenarios, if your site goes off-line you are notified (or equally you can notify them) and there will be a technician work to get it back on line as soon as possible. If there are more subtle performance issues with your site and the hosting platform could benefit from configuration changes, you will also have access to a technician to both rede and make the necessary changes for you.

In fact many hosting providers will offer very high uptime (site availability) guarantees to back up their support claims if you take up their hosting options. You may see guarantees of up to 99.99% or even, in some cases, 100% uptime.

Self Managed

To confuse the picture, however, the term managed hosting can also be employed for hosting packages which in truth are more self managed; where the provider gives you access to an online control panel so that you can fully manage the server configuration yourself.

It is certainly worth checking the details of what each package offers before signing up for it. The devil is often in the detail and as mentioned above, one hosting package is unlikely to be directly comparable to another.

Ultimately, if you want or need to have high levels of expertise available to you around the clock (and receive the guarantees that come with it) you’ll need to be willing to pay out a little bit more. Although if the uptime of your site, an e-commerce site for example, is key to your business’s success, a comprehensive managed hosting package may be worth the investment.



Posted in HostingComments (0)

Use of messages as an integral part of business services with the help of sms server


Use of messages as an inbuilt part of business services with the assist of sms server

Article by Deepak

There are many businesses using text message as an integral part of their services and are able to rendered improved levels of service to their customers. Use of text message to promote businesses is something identical popular among businesses. But engaging customers with the help of text message and increasing over the overall service experience is really lucrative and new trend.

Businesses like banks, investment options, medical services and accompanying providing soft solutions use text message frequently to provide services over the mobile. For an example when a particular transaction is done with a bank account then owner instantly gets an alert message for the same briefing about the whole transaction to the owner of the being. Using text message as support services has many other benefits included increased level of customer satisfaction, high level of interaction with customer, limit less support to customers etc.

Most of the bulk Sms service providers consider only business promotion activity using mass sms but very few veteran service providers also provide overestimated added services by using a sms server and sms api. In most of the cases text messages are automated one means there is no need to directed customized messages to each of your customer. Normally there Is a fixed code to inquire about a fixed service and on sending particular code to a fixed number sender of the message gets desired information in return automatically.

This whole process is done over a sms server; server tin receive or send messages automatically through a mobile phone or through a computer (text from computer). Sms server provides a real aid where the volume of such messages or text from computer is quite high. While different types of data gathering and particular responses to a message can be obtained by sms api (application programming interface). Sms api is an interface where different types of codes can be applied over a sms server to respond for a particular message query.

There are many companying using messages for customer information purpose for example if you visited a particular shop and looking for a product which is not currently available then owner of the shop will send you a sms when that particular product is available. Few merchants use to send information astir promotional products and other related information to their regular customers. These practices are identical helpful in customer retention purpose.

So messages can be used as an integral part to business services and for different information purposes to customers. These practices are selfsame helpful in increasing customer experience level and for customer retention purpose also. As mentioned in this article before use of text message to promote businesses is identical common these days reason being the increased used of mobile phones and popularity of messages among the folks.

There are many bulk sms providers which uses mass sms of text online to send thousands of promotional messages. Theses messages are often termed as business sms also. Any bulk sms provider mainly uses sms api, sms gateway and message sending software to send thousands of messages within an identical short span of time. There are many types of messages that can be sent to prospective customers like text messages, flash messages, multimedia messages, single way messages and messages with reply able path.



Find More Servers Articles

Posted in HostingComments (5)

Adding Markers Using the Google Map API and jQuery Part 3


Adding Markers Using the Google Map API and jQuery Part 3

This function is a little more perplexing, but it’s so straightforward to make sense of. First we call jQuery’s $ .get procedure to execute an Ajax GET request. The procedure takes two parameters: the URL to demand (in this case, our localized XML file), and a callback function to execute when the demand concludes. That function, in turn, will be passed the answer to the demand, which in this case will be our XML.

jQuery delicacies XML precisely the identical as HTML, so we can use $ (xml).find(‘marker’).each( … ) to loop over each marker component in the answer XML and conceive a marker on the chart for each one.

We catch the title and address of the markers, then we conceive a new LatLng object for each one, which we accredit to a point variable. We continue the bounding carton to include that issue, and then conceive a marker at that position on the map.

We desire a tooltip bubble to emerge when a client bangs on those markers, and we desire it to comprise the title and address of our location. Therefore, we require to add an happening listener to each marker utilising the Maps API event.addListener method. Before we manage that, though, we’ll conceive the tooltip itself. In the Google Map API, this type of tooltip is called an InfoWindow. So we conceive a new InfoWindow, and furthermore set up some HTML to fill it with the essential information. Then we add our happening listener. The listener will blaze when one of the markers is banged, and both set the content of the InfoWindow and open it so it’s evident on the map.

Finally, after supplementing all the markers and their affiliated event handlers and InfoWindows, we fit the chart to the markers by utilising the Maps API’s fitBounds method. All we require to overtake it is the bounds object we’ve been expanding to encompass each marker. This way, no issue where the chart has been zoomed or panned, it will habitually break back to an perfect zoom level that encompasses all our markers.

Tying It All Together

Now that our cipher is prepared, let’s put it into action. We’ll use jQuery’s $ (‘document’).ready to delay until the sheet is laden, then initialize the chart, pointing it to the sheet component with an id of map utilising the #map selector
string:

$ (document).ready(function() {

$ (“#map”).css({

height: 500,

width: 600

});

var myLatLng = new google.maps.LatLng(17.74033553, 83.25067267);

MYMAP.init(‘#map’, myLatLng, 11);

$ (“#showmarkers”).click(function(e){

MYMAP.placeMarkers(‘markers.xml’);

});

});

We furthermore adhere a bang happening listener to the #showmarkers button. When that button is banged, we  call our placeMarkers function with the URL to our XML file. Give it a rotate and you’ll glimpse a set of made-to-order markers show up on the map.

Summary

You’ve likely estimated that there’s many more to the Google Map API than what we’ve enclosed here, so be certain to ascertain out the documentation to get a seem for everything that’s possible.

Posted in DevelopmentComments (133)

Adding Markers Using the Google Map API and jQuery Part 2


Adding Markers Using the Google Map API and jQuery Part 2

Now that we have our rudimentary libraries, we can start construction our functionality.

Outlining the Script

Let’s start with the skeleton of our chart code:

var MYMAP = {

bounds: null,

map: null

}

MYMAP.init = function(latLng, selector) {

}

MYMAP.placeMarkers = function(filename) {

}

We’re wrapping all our chart functionality interior a JavaScript object called MYMAP, which will assist to bypass potential confrontations with other scripts on the page. The object comprises two variables and two functions. The map variable will shop a quotation to the Google Map object we’ll conceive, and the bounds variable will shop a bounding carton that contains all our markers. This will be helpful after we’ve supplemented all the markers, when we desire to zoom the chart in such a way that they’re all evident at the identical time.

Now for the methods: init will find an component on the sheet and initialize it as a new Google chart with a granted center and zoom level. placeMarkers, meantime, takes the title of an XML document and will burden in coordinate facts and numbers from that document to location a sequence of markers on the map.

Loading the Map

Now that we have the rudimentary structure in location, let’s compose our
init function:

MYMAP.init = function(selector, latLng, zoom) {

var myOptions = {

zoom:zoom,

center: latLng,

mapTypeId: google.maps.MapTypeId.ROADMAP

}

this.map = new google.maps.Map($ (selector)[0], myOptions);

this.bounds = new google.maps.LatLngBounds();

}

We conceive an object literal to comprise a set of choices, utilising the parameters passed in to the method. Then we initialize two things defined in the Google Map API—a Map and a LatLngBounds—and accredit them to the properties of our MYMAP object that we set up previous for this purpose.

The Map constructor is passed a DOM element to use as the chart on the sheet, as well as a set of options. The options we’ve arranged currently, but to get the DOM component we require to take the selector string passed in, and use the jQuery $ function to find the piece on the page. Because $ comes back a jQuery object other than a raw DOM node, we require to drill down utilising [0]: this permits us to get access to the “naked” DOM node.

So one time this function has run, we’ll have our chart brandished on the sheet, and have an empty bounding carton, prepared to be amplified as we add our markers.

Adding the Markers

Speaking of which, let’s have a gaze at the placeMarkers function:

MYMAP.placeMarkers = function(filename) {

$ .get(filename, function(xml){

$ (xml).find(“marker”).each(function(){

var title = $ (this).find(‘name’).text();

var address = $ (this).find(‘address’).text();

// conceive a new LatLng issue for the marker

var lat = $ (this).find(‘lat’).text();

var lng = $ (this).find(‘lng’).text();

var issue = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));

// continue the bounds to encompass the new point

MYMAP.bounds.extend(point);

// add the marker itself

var marker = new google.maps.Marker({

position: point,

map: MYMAP.map

});

// conceive the tooltip and its text

var infoWindow = new google.maps.InfoWindow();

var html=’‘+name+’

‘+address;

// add a listener to open the tooltip when a client bangs on one of the markers

google.maps.event.addListener(marker, ‘click’, function() {

infoWindow.setContent(html);

infoWindow.open(MYMAP.map, marker);

});

});

// Fit the chart round the markers we added:

MYMAP.map.fitBounds(MYMAP.bounds);

});

}

Find More Jquery Articles

Posted in DevelopmentComments (6)

Colocation Server Hosting Part 1


Colocation Server Hosting Part 1

Colocation Services are the good choice for those business entrepreneurs who have their own dedicated servers, but do not want to maintain server in their own place. Therefore, many individual entrepreneurs and organization place their web servers to a colocation service provider where they charged for rack space, bandwidth, and essentially hardware equipment.

 

These services are perfect for those companies or people who take care of large websites that get lots of traffic every day, particularly if they get a lot of downloads or uploads through their websites. Generally, they should be utilized where the expense of bandwidth would be more to the business than is the expense of the service. This functions because the bandwidth is shared with the provider who usually pays much less for bandwidth due to the bulk requirements of the provider.

 

Individuals and organizations with large sites that receive a lot of traffic every day, or who receive a lot of downloads from their site or additions to their site, are those best suited to the use of this service.

Typically, these kinds of services are really works well where the expense of bandwidth and maintaining servers would be more costly for the company so they need choose colocation server hosting for more benefits. Apart from this, bandwidth cost is shared between web host and ISP providers that usually pay less for bandwidth charge because of the high volume requirements of the web hosting provider.

 

Even it is possible to rent a server from the service provider, which may be useful for those companies who do not have their own dedicated servers.

In this case, the organization does not have the server, but will own the data stored on it (usually a dedicated server). This is really a great option to those who wants to purchase dedicated web hosting services in cheap price.

This article written on Colocation Web Hosting . For More Information about Colocation Services India Visit Here.

Posted in HostingComments (2)

Colocation Server Hosting Part 2


Colocation Server Hosting Part 2

As we discussed some advantages of colocation server hosting in first article. Now here we are going to discuss couple of important aspects which you need to be consider while choosing colocation services.

 

Before selecting to use one of these services, there are a number of things, an organization must take into consideration. Above all, first watch your bandwidth requirements, then take any decision. Above all, first watch your bandwidth requirements, then take any decision. In some cases, the cost of using this type of service is more expensive than the actual price of the bandwidth would be if you were hosting the server yourself or using a shared hosting service. It certainly comes down to the use and value of the site. Companies that have a lot of popular sites that receive tons of web traffic and then use lots of bandwidth will often find that these services are much cheaper compared to hosting dedicated servers in own place.

 

The cost of service will depends primarily on the physical size of the server (servers are often in the range of 1U to 4U around), more servers so more expensive because they take up extra space.

In case of custom requirements, service provider also offer quarter, half, or full rack cabinets to serve users colocation server requirements. There is also a connection fee and costs associated with the type of connection used. The size of the connection can varies from company to company.

 

There are many advantages to using a colocation web hosting service.

First, they have technicians who can solve all the problems that can affects the operation of the server (such as power outages, which explains why there is usually a backup service provided). Secondly, service provider is able to provide more rack-space to maintain the servers, typical of this simply because it is important for service provider to offer better protection for themselves and their customers.

This article written on Colocation Hosting . For More Information about Colocation Services India Visit Here.

Posted in HostingComments (1)

Access or SQL Server? Choosing a Database (part 1 of 2) – Reasons not to Choose SQL Server


Access or SQL Server? Choosing a Database (part 1 of 2) – Reasons not to Choose SQL Server

SQL Server is a powerful database: it supports multiple users with ease, and is designed to cope with databases with millions of records.  However, you do pay a price for this robustness …

In the belief that the easiest way to evaluate software is to concentrate on its down side (the software vendor will amply fill you in on the plus points), here are three and a half reasons why you might NOT choose SQL Server as a database application.

Written by Techie People, for Techie People

The main user interface to SQL Server (the place in which you create tables and views) is called SQL Server Management Studio.  While this does let you do everything you need to, there are few concessions to usability or modernity.  Here are a couple of examples.

Suppose you’ve got two tables: members of staff and the departments they work in.  Each member of staff record stores the department id of the department they work for.  In Access you can use a lookup wizard to tell Access to display the department name, but store the corresponding id (so you see “Accounts” even though the data stored is actually the department number, 13); in SQL Server it’s up to you to know the department numbers, since combo boxes/dropdowns like this are so hard to create.
When creating a database diagram in SQL Server, you connect two fields together.  As you move tables around, the lines joining the fields (the “relationships”) don’t follow with them, so it can appear as if you had created relationships between completely different pairs of fields.  Irritations like are hard to forgive in the 21st century!

Microsoft put huge amounts of work into trying to make Access easy to use; it’s a shame that they’ve never invested the same effort in improving the usability of SQL Server.

Need to Learn SQL

SQL Server uses a variant of the SQL Structured Query Language called T-SQL or Transact-SQL for its queries (although you can write views  without using SQL).  Whereas you can easily survive using Access without knowing SQL, you won’t get far in SQL Server without it.  Added to that the need to learn the stored procedure language, which is based round SQL, and you’ve got a serious learning curve ahead of you.

Need to write a front end

You wouldn’t develop a SQL Server database and give it to a client in its base format.  Instead most developers create a “front-end”, containing the menus and forms for your database.  These could be written in Access, using Windows Forms, using ASP.NET or PHP as a website, using Delphi, or using any other menu/form application, but whichever you choose you’ve still got another application to write.

Cost of SQL Server

SQL Server isn’t cheap (the last time the author looked, it cost over 4,000 UK pounds for a licence), although you can download SQL Server Express free of charge, and this works in exactly the same way for all but the largest databases.

Our conclusion?  SQL Server is much pleasanter to use as a database engine than Access, simply because it rarely if ever falls over and it runs so quickly.  That said, unless you’re a SQL expert you’ll want to create all of your forms, queries and reports in a front-end application like Access.  However, for ease of deployment and upgrade, we’d choose an ASP.NET website with a SQL Server back-end any time (but then, we do already know Visual Basic, Visual C#, Visual Studio, SQL Server stored procedures and HTML).  For the novice, we’d suggest creating an Access database first, then upgrading it to SQL Server if or when it starts falling over.

Andy Brown is a director of Wise Owl Business Solutions, a company offering Access training and database development and SQL Server training and systems.  .


Article from articlesbase.com

Related Sql Articles

Posted in DevelopmentComments (3)

Web Hosting?… Part Two


Web Hosting?… Part Two

 

So now we carry on with Part Two of our guide to different kinds of Web Hosting, kindly illustrated by the adventures of a man called Dave*.

In the last part, Dave has had experience with Free and Shared Hosting, but he’s now looking at getting advanced Web Hosting to offer him greater control and performance from his eCommerce store. Below are several of the options available to Dave.

It’s worth pointing out that, when Dave bought his Web Hosting, he went with a local (in this case, UK based) company, rather than one based abroad. There are several benefits to this – Dave had heard that Google preferred sites to be Hosted in their own country for their search engine results, but to Dave the important thing was that the company offered support in his own time zone – always worth considering, as even though many companies offer 24 hour support, Dave would rather not be talking to someone when it’s 3 in the morning for them (or, even worse, when they are all in bed when he gets to work).

 

VPS (Virtual Private Server)

VPS is a step up from Shared Hosting, and a step down from a full Dedicated Hosting solution. Just as a server can provide separate hosting accounts for hundreds of people at a time, a server can be configured to divide it into several sections, all separate from each other. Each of these sections can then be run as if they were their own Dedicated server, and so by purchasing VPS you have full control over and access to your own (virtual) server and the contents of it.

VPS gives you the benefits of Dedicated hosting, without the expense. You also don’t have to manage the actual server itself, and should anything go wrong your entire ‘server’ can be restored very quickly. It does require a level of technical knowledge to use properly, despite the fact that a lot of VPS services can be administered through modern control panels, and VPS is more expensive than Shared Hosting. It is, however, an excellent move towards Dedicated hosting without the commitment.

Dave is very tempted with this option. He gets almost all the benefits of having his own server, he won’t have to worry about other users affecting the speed of his site – and so he can confidently expand his own site without worrying about it appearing slow to users. He’s a bit concerned that he might not know what he is doing, as Shared Hosting is fairly easy to use, so he still wants to consider Dedicated Hosting along with some kind of Hosting Management to make sure everything is working correctly. Despite this, VPS is cost effective and less intimidating than Dedicated options, and he likes the thought of being able to restore his entire VPS should he make a mistake.

 

Cloud Hosting

Cloud Hosting bears similarities to Cluster Hosting. Instead of hosting a site on a single server, sites are hosted across a cluster (or cloud) of servers, that are all linked together to form a cloud (or cluster) containing the same information. Your hosting is, essentially, a VPS within a VPS. Although incredibly difficult and expensive to work, there are many benefits to this system – namely that, should one server go down, your site will not, as there are any number of other servers taking the load – and performance is rarely an issue, as the load is shared among many different computers. As it is also a relatively new and complicated method of hosting, you may find that there are compatibility issues that prevent your site from working properly.

Dave looks at Cloud Hosting as it is generating a lot of interest, and it will allow him to have Shared Hosting without the performance drawbacks that he may experience when his site really takes off. Consistent uptime and performance due to relying on a group of servers rather than one or two is very appealing to Dave. However he’s a bit concerned that his site might run in to compatibility issues due to the complicated nature of Cloud Hosting and the very intricate designs he has in mind for his site, and as he wants to upgrade from Shared Hosting, he isn’t too interested in remaining in what is essentially a Shared environment that he doesn’t have full control over.

 

Dedicated Hosting (Managed and Unmanaged)

Dedicated Hosting is an advanced Web Hosting solution, where your website(s) are Hosted from your own server. It is an advanced solution but the control and power you gain make it the choice for high traffic websites or hosting with very specific requirements. Resources are only Shared if you decide to share them, and you can specify the Operating System, CPU speed, Memory and Disk Space of your server to meet your needs.

Dedicated Hosting comes in two broad categories – Managed and Unmanaged. A Managed server means that, although the server is yours, someone else manages the performance, installation, configuration and support of your server (depending, of course, on your contract with the people managing your server!). An Unmanaged server is provided on an ‘as-is’ basis and you will have to deal with the support yourself. It is common in these cases for support from the people who have provided the server for you to be charged. Often, Managed servers will be more expensive as standard, but potential support costs with Unmanaged servers may outweigh this.

Dave looks long and hard at Dedicated Hosting. It is the option he had in mind when he considered upgrading, and though VPS is very appealing, he knows that a Dedicated solution will, without a doubt, give him the advanced hosting he needs, even if it will come at greater expense.

As his knowledge is above average but less than confident, Dave is presented with a dilemma. Does he hire someone to take care of his Hosting, and go for a managed server – or does he attempt to work with a company offering Unmanaged servers, and take care of most of it himself?

A Dedicated server will often require a lot of work to set up, but little work after this point if done correctly. Of course the support of the server can run into highly advanced areas, and this concerns Dave (it’s why a Managed option or VPS seems better). In the end he has to decide what he would prefer – Dedicated hosting gives him total control over the Web Hosting environment for his site, and it also lands a lot of the responsibility for his Hosting at his feet!

As a side note, this solution usually means that you don’t purchase the server itself – you rent a server to your specification from the Hosting Company.

 

Co-Location Hosting

Co-location Hosting is similar to Dedicated Hosting. However in this case you own the server yourself – you simply rent the space it occupies from the Hosting company (i.e. you pay them to house your server in their Datacentre). You pay the Hosting company to keep your server secure and operational, and the rest is up to you.

This is not something Dave is interested in. As he doesn’t know exactly what he wants, needs, or is doing, ‘Co-Lo’ seems too much for him. It’s an option usually reserved for large companies requiring the very best in Web Hosting, who contract teams to build and manage their own servers for them.

 

And so we have reached the end! There are a few more kinds of Web Hosting available to you – including running a server from your own home – but we (and Dave, of course) have covered the main ones. Hopefully the guide has given you a better understanding of the different kinds of Web Hosting you can purchase – so that you can decide what it is you want, and work your way through the long list of Web Hosts trying to convince you that they are the Host you want!

 

*Dave is still not real. He is just for illustrative purposes only, and any resemblance to any Dave or any events that have happened to any Dave, living, dead or otherwise, is purely coincidental.

Related Colocation Hosting Articles

Posted in ColocationComments (1)

How To Start Forex Trading In Malaysia – Housewife Earns Extra Income by Trading Forex Part Time


How To Start Forex Trading In Malaysia – Housewife Earns Extra Income by Trading Forex Part Time

How To Start Forex Trading In Malaysia

In Japan and Korea, there are millions of housewives who are trading foreign exchange currency online part time and making small daily profits to earn extra income. In fact, there are an estimated more than 40 million educated forex traders are trading forex online for living.

In a recession time like now, less money made from the Husband caused less money given to the Housewife as well. When many companies are retrenching and pay cutting, the income of the Husband, who is the only one who make money, would be definitely affected. Therefore, the Husband might also provide less and less monthly allowances to the housewife for food and other daily necessities. With all the cleaning and nursery jobs for the beloved kids, it is not easy to get a part time job and earn extra income for the family. What else can a desperate housewife do?

Eventually, full time housewives could trade forex online part time and make extra income like USD50 to USD100 per day for food, groceries and other necessities. What does a housewife need? All they need is just a computer with internet access at home. Then, they need to learn a proven and tested forex trading strategies and start trading. How To Start Forex Trading In Malaysia

Somehow, some housewives may have other concerns, like they have no time to look at the forex market! The Forex market is running 24 hours from Monday to Friday only. Forex Traders can always enjoy lifestyle and quality time with their families during weekends. A part time forex trader will only need 1 to 2 hours per day to make money from the lucrative online forex market. A currency pair like USD/JPY moves up or down within 200 to 300 pips in a day. To earn USD100, a good fx trader will only will need to profit 10 pips within a very short period of time. Housewives just have to scarify 1 hour of their afternoon nap time or 1 hour of watching TV time to make extra money daily.

There is another advantage of a housewife trading forex. In general, women are more discipline compared to men. The secret of every successful forex trader is using proven and tested forex strategies coupled with conservative money or risk management and very tight discipline (follow the winning forex strategy all the time). Many male currency traders tend to imply their own theory using existing forex strategies and sometimes enter to a trade even though it is not a confirmed trade!

So, how a housewife shall start to make part time extra income in forex trading? First, learn to trade forex with a reputable financial school. In Malaysia, there are more than dozens of forex schools but not all are very good. Find a forex training course that will provide continuous supports and coaching is very crucial. After that, start practicing your forex trading online until there is a consistency in monthly profits, for example at least 5% to 10% per month. Then, just continue to trade forex and make extra money part time every day. How To Start Forex Trading In Malaysia

Posted in ForexComments (2)

Techniques For Integrating Hibernate Into Legacy Java Code – Part 1


Techniques For Integrating Hibernate Into Legacy Java Code – Part 1

If you’re like me, you spend a lot of time dealing with legacy code that, for whatever reason, does not take advantage of modern methodologies and libraries. I’ve taken over Java projects that contain hundreds of thousands of lines of code and not a single third-party jar other than a JDBC driver! One of the most common examples of this is the implementation of the data access layer. These days, the de facto methodology involves Hibernate and DAOs, usually managed by Spring.

This article will detail the steps I recently took to covert a large application from custom-written data access to Hibernate and Spring using the refactoring facilities in Eclipse. The key with this refactorization is to get the existing business logic code (Struts Actions, JSPs, Delegate classes, Business Service classes, etc.) to access the datastore using Hibernate, managed by Spring, without manually changing any of that code directly. Part 1 will include creating the Hibernate data object classes, DAOs, and refactoring the existing code to work with these newly created types. Part 2 will conclude the project with integration of the Hibernate DAOs and wiring everything up with Spring.

First of all, we need to create our Hibernate model and DAO classes. Obviously, since we’re dealing with a legacy application and data structure, we will want to use a bottom-up approach to building our data access layer. This just means that we’re going to generate the Java code and appropriate Hibernate config files from the existing database. There are many tools freely available to make this process very painless. I recommend an Eclipse Plugin for creating and maintaining the Hibernate artifacts (Google “Hibernate Eclipse Plugin” to get started). The structure and requirements for creating Hibernate classes and config files are well documented elsewhere, so I won’t go into detail here. However, in this particular project, the Hibernate DAO lifecycles are managed by Spring, so the DAO classes should all extend HibernateDAOSupport.

Now we have java classes (POJOs) which map to our database tables, but none of the existing code uses these new data object classes. This is where the refactoring tools of Eclipse comes in really handy. For example, say we have a legacy class called AccountInfo which corresponds to the ACCOUNT database table. Right-click the class and select Refactor -> Extract Interface. On the dialogue box, call the new interface IAccount and make sure you select “Use the extracted interface type where possible.” Choose the other options according to your preferences. Click OK and kick back while Eclipse changes every occurence of AccountInfo references to IAccount references and recompiles. Of course, do this with each object model class.

If you never realized why OOP languages are so great, you’re about to. Now we’re going to refactor the code so that all of the existing legacy can be hooked into the new Hibernate model classes instead of the legacy ones. Continuing with the AccountInfo example, create a new class – you’ll probably want to create a new package for this step – called Account that extends the Hibernate POJO for Account and implements the new IAccount interface.

This next part is the most time-consuming, but really isn’t that bad. At this point, the newly created class will probably contain a bunch of empty methods containing only TODO comments. This is because the IAccount interface most likely defies a bunch of methods that are not implemented in the Hibernate Account POJO. To deal with these, we basically want the new Account class to delegate to its generated superclass whenever necessary to satisfy its contract as an IAccount type. As a real world example from the application I was working on, the legacy AccountInfo class defined a getter/setter pair for a property called username, whereas the corresponding column in the ACCOUNT table was actually LOGIN_NAME. To deal with this, you would simply implement the get/setUsername methods in Account to delegate to get/setLoginName (from its superclass). I also had to translate between various data types quite a bit. For example, the legacy code would define many properties as Strings even though the corresponding piece of data in the database was defined as an INT or TIMESTAMP. Again, do this with each object model class.

To finish up the data model layer, edit the appropriate Hibernate and Spring configuration files to refer to these new object model classes. The application now has the ability to map database records to Java objects via Hibernate, and the legacy code which refers to these classes has not required any editing by hand. To finish up this refactorization project, we need to hook in the Spring-supported Hibernate DAOs in a similar way. In Part 2 of this article, I will discuss refactoring the legacy code to read, write, and update data using Hibernate and Spring.

Posted in JavaComments (1)