Digant Shah, Author at Perception System Just another WordPress site Wed, 28 Feb 2024 09:50:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 https://www.perceptionsystem.com/wp-content/uploads/2022/12/ps-favicon.png Digant Shah, Author at Perception System 32 32 Laravel vs NodeJS: Which One You Should Opt for in 2022 https://www.perceptionsystem.com/blog/laravel-vs-nodejs-which-one-to-opt-2021/ Fri, 19 Mar 2021 11:12:27 +0000 https://www.perceptionsystem.com/?p=37748 There are various programming and scripting languages in the world of web development. These programming and scripting languages can be used for web development, mobile application development, web APIs, or any other internet-based facility. Various frameworks are available for developers to take leverage and start their development journey. The special built-in features of these frameworks […]

The post Laravel vs NodeJS: Which One You Should Opt for in 2022 appeared first on Perception System.

]]>

There are various programming and scripting languages in the world of web development. These programming and scripting languages can be used for web development, mobile application development, web APIs, or any other internet-based facility. Various frameworks are available for developers to take leverage and start their development journey.

The special built-in features of these frameworks make the whole development process less time-consuming and provide faster development turnaround time for web applications. A huge number of frameworks are available in the open market. In this blog post, we have tried to compare the two most popular frameworks in development i.e. Laravel and Node.

What is Laravel?

Laravel is an open-source, PHP-based framework used usually for developing web applications. Developed by Tailor Otwell in 2011 it follows a model-view architectural pattern based on symphony which does not have an IO model. For web development in sectors like careers, education, shopping, and many other website categories Laravel is the most popular PHP framework often used by developers.

Laravel holds a 0.37% market share in the category of all web development frameworks. Let’s now examine the pros and cons of using Laravel for web development.

Pros

  • For PHP-based web developers, Laravel is the best framework to use.
  • Laravel development companies use Laravel as it is quick and easy to understand.
  • It is based on an MVC template, which removes the need to write HTML codes for the website.
  • Laravel development service allows you to fast testing and automation for your website.
  • It comes with a built-in templating engine to support the creation of smooth and effective website layouts.
  • Laravel works with the updated MVC frameworks rather than classic architecture where developers need to write both HTML and PHP in one file.

Cons

  • Laravel lacks built-in software and requires third-party integration.
  • It is extremely a slow framework and programmers need to be professional PHP developers to use it.
  • Laravel has very little community support compared to other frameworks.
  • The framework is still in the development phase and composers are not as good as Node, Python or Ruby Jems.
  • Methods included in the reverse routing process are extremely complex in Laravel.
  • Legacy systems cannot get easily transferred to Laravel.

Hire on-demand dedicated developers of desired skill & experience.

What is Node JS?

Just like Laravel, Node is also an open-source framework for web development. Node’s run-time is based on Google Chrome’s Runtime Engine. Node executes JavaScript outside the browser. Node’s cross-platform environment enables the building of server-side applications. Node comes with in-built JavaScript programs that can be run on iOS, Linux Microsoft Windows within Node.js runtime.

In 2020 alone, more than 51% of web developers regarded Node.js as the most used tool compared to other frameworks. Let’s now try to understand the pros and cons of Node in brief.

Pros

  • .js runs on a single thread yet it has the request to serve the capabilities of various clients.
  • Node can perform effectively which constructing API’s.
  • A single code on Node runs correctly on both clients as well as the server’s side.
  • It provides huge group and community support.
  • Node comes with an outstanding package manager.
  • This framework makes it easy to handle fast and consequent requests from the users.

Cons

  • Programming on Node is asynchronous which is considered by many developers to be difficult to operate.
  • .js does not consist of a dedicated library for finishing tasks and you need to rely on third-party libraries for performing your tasks.
  • On the basis of a relational database, Node is very tough.
  • Node is single-threaded and does not work on CPU-intensive devices.

Laravel v/s NodeJS (a comparison)

Laravel and Node both of these PHP frameworks come with their own sets of features and capabilities. It totally depends on your decided outcomes with your web development venture that which framework are you going to use. If you want to avoid the hustle of third-party integrations for your website’s security and design requirements then you can use Laravel. Convinced enough to build your website on Laravel? We suggest hiring a Laravel development company. But, if your aim is to create lightweight, efficient, and performance-based websites and mobile applications then you can hire Node developers for your web development needs.

Hire dedicated team for your next web development project.

Finally…

Are you looking for a Laravel development company that provides you great Laravel development services? Then get in touch with our exceptional team, for your businesses’ web development requirements at Perception Systems. For more information email us your requirements on info@perceptionsystem.com for Laravel development solutions for your business.

The post Laravel vs NodeJS: Which One You Should Opt for in 2022 appeared first on Perception System.

]]>
10 Reasons Web Developers Should Learn Web Designing https://www.perceptionsystem.com/blog/web-developers-learn-web-designing/ Mon, 06 Feb 2017 00:00:00 +0000 https://www.perceptionsystem.com/web-developers-learn-web-designing/ Now, it becomes essential for web developers to learn web designing, but you know why?And what type of benefits they can get by learning web designing? Go through this blog and know why developers should learn web designing!

The post 10 Reasons Web Developers Should Learn Web Designing appeared first on Perception System.

]]>

As a professional web developer, you are only responsible for website development. Right? You may only care about developing interactivity on the website like submitting forms to the database, jQuery and Ajax validation forms, sliding menus, rollovers and many other features of the website, which requires programming skills.
Now, what about designing part? Have you thought about learning web designing anytime as a web programmer? No? Well, in this blog I would like to encourage web developers to learn web designing skills. It is because learning designing skills may benefit them in a good deal in the long run.

Let’s have a look at why web developers or web programmers should learn web designing skills and how it can benefit them.

User Experience Considered as a Leading Thing

These days, developing a high-end website needs a lot more than just coding. Instead of considering how interactive your website is, website visitors may expect to have a good experience.
Therefore, if you have ignored the design of website and overall structure, it may look bad. Hence, you can lose website traffic considerably as well as ranking in bonus.

Does a web developer needs to do more than just code generating?

With rapid changes in web development technologies in the modern era, web developers should think their role out of traditional programming role.
By nature, the web developers are problem solvers, so they mainly opt to make the web pages, just working, instead of trying to make web pages attractive and capable of delivering excellent results. Unfortunately, just coding or programming role may not appropriate these days.

Let’s take an example

Suppose you are a client and opt for developing a medium to big size website. Now, you are going to hire a team of web programmers or web developers with programming skills only.
Naturally, they web programmers hardly accustomed to web designing and graphic designing tools. If they are, it is expected they never match the skills to the seasoned web designers who have spent a considerable amount of time and efforts to acquire expertise.
Therefore, you need to hire another team or a web designer with graphics and other designing expertise at the professional level. However, it is good to hire two separate entities, web programmer/s, and web designer/s, for a medium to a big project, but what about small and medium projects with budgetary constraints?
Naturally, you might be looking for a web developer or a small team of web programmers with both skills, programming, and designing. Thus, you can save time, money, and resources to obtain website or web application within your budget as well as before deadline to sustain the fiercely competitive market.
Moreover, there are some additional advantages for that a developer should go beyond coding and enhance their web designing skills:

  • In order to become more professional and responsible member of the team or a company
  • If a professional web developer creates an attractive website, it may go in favor of web developer to get more projects or big applauds from clients or company where developer is working
  • When a developer working on both tasks, designing and programming, it may not leave any room for dispute or gaps in collaboration/communication

Reasons Why a Professional Developer Should Learn How to Design

As we all know that being a web developer is a great thing, but if being a web developer, who knows how to design eye-catchy website, it is really a very great thing. Have a look at the reasons why a web developer should learn to design:

Hire on-demand dedicated developers of desired skill & experience.

Boost Attractiveness of Your Website

A web developer can easily distinguish a beautiful website from a horrible one only when the developer has the knack to judge the web design. Logically, it is only possible when a web developer knows designing and have spent the time of a number of designing projects in real life.
Therefore, a web developer, with an eye as visual expertise can boost the aesthetics of website more. Thus, the website may become more refined.
Moreover, the web designing skills can lead web developers to deviate acclimatize aesthetics during the web development process.

Can Incorporate Material Design Trends

Material design is based on geometric shapes, brings depth and realism to your site. Therefore, if a web programmer has expertise in web designing using material design, it would be great for a project.
Moreover, material designing involves more code and less designing work, so it makes life easy for a programmer.

Can Make Responsive Web Design

Mobile friendliness for a website or web application is compulsory to attract a vast audience of mobile users and gaining ranking in SERP. Therefore, if a web developer is capable of responsive web designing and coding accordingly, it makes big differences for a client with limited budget and timeline.

Can Make Single Page Parallax Website

Touch screen design favors infinite scrolling, so the latest web design trends favor single page website with tons of multimedia content. That visually eliminates like menus and some navigational architects.
For a web designer and programmer, it is challenging to bring everything on a single page and gives the best UX as well as usability. If a web programmer can acquire such skills, it proves cost-effective to hire the web developer with designing and programming flairs.

Can Bring Unique Images

Yesterday, it was stock photos rocking on the web, but today unique and customized images are working on the web. It needs some graphic designing and web designing skills to bring unique multimedia content including images, videos, and animations on your website.
Thus, it is mandatory for a web programmer to have designing skills on hand to bring uniqueness.

Can Bring Data Visualization

Today data and analytics is becoming more significant than ever. Therefore, data presentation skills such as tabulation, graphs, charts, and other visual presentation skills can make much difference in aesthetics, comprehensions, and UX of your website.
If a web developer can learn these during web designing learning process, your website might have great appeal and excellent user experiences across the devices.

Can Incorporate Minimalistic Web Design Trends

In 2017, minimalism has taken a whole new level, and ‘card’ concept is rocking. Technically, cards are entry points on the website and act as doorways to gain details regarding the content presented on the card.
Custom photos and designs are content on the card to suggest a topic visually and entice website visitors to click to engage further. Images and multimedia content including videos are best ways to make effective presentations with consumption of less space.

Can Bring Next Generation Web Development Trends

Today many upcoming technologies are under process to give new dimensions to the web development industry. For instance,

  • The progressive web app development using manifest, service workers, and shell architecture technologies
  • Static website development using static web page generators to bring dynamism with the best performance
  • Responsive web development for desktops, laptops, smartphones, tablets, and some wearable devices

Therefore, web programmers must learn the modern HTML, CSS, and scripting technologies (JavaScript, CSS Media Queries, jQuery…), tools, and techniques to deal with upcoming trends in 2017.

Can Bring Conversational UI

The latest trends suggest the more usage of conversational user interfaces such as chats, IM, and other natural language interfaces to interact with companies, services, and bots.
Therefore, web developers with designing skills can incorporate these conversational UI elements with their websites and web applications easily.

Can Bring High-performance

People and search engines may find hungry more for high-performance. Loading speed of your website is the first target among the key performance parameters to hit.
Therefore, web programmers must learn the image optimization, GIF-like lightweight animation development, and other smart UI element designing techniques to satisfy website visitors as well as bots to rank your website and bring good conversion rate with high ROI.

Hire dedicated team for your next web development project.

3 Simple Tips on How to Learn Web Design

Look for Motivation: You can check-out wonderful web design and its trends for motivation, and ultimately you can refine your web design taste.
Try-out Some Web Design Tutorials: You should also practice some of the tutorials about web design as it will enhance your web design skills and expertise.
Get Some Feedback: The best way to learn is to begin doing and getting feedback. The main thing is to ensure that your web design is easy-to-use and simple, offering a rich content and feature set.

Last Thoughts

Learning web designing is extremely important for web developers as they can get a lot of benefits by learning web designing. Thus, every web developer should learn web designing as it can benefit them in many ways.
Stay connected with us to get more information on web designing, and its new trends that you can adopt. Moreover, you can also hire a professional web developer to discuss your project requirements.

The post 10 Reasons Web Developers Should Learn Web Designing appeared first on Perception System.

]]>
15 Best Responsive CSS Grid Systems for designing Website https://www.perceptionsystem.com/blog/responsive-css-designing-website/ Wed, 09 Sep 2015 00:00:00 +0000 https://www.perceptionsystem.com/responsive-css-designing-website/ Want to create beautiful responsive site layout with CSS responsive grid systems?
Check out below listed best and most useful flexible grid tools that used for developing responsive websites without much difficulty.

The post 15 Best Responsive CSS Grid Systems for designing Website appeared first on Perception System.

]]>

Grid is a simple block that created of horizontal or vertical or curved guidelines to make eye-catchy designs. With the help of Grid, one can easily arrange graphical elements systematic.

When we are designing web page, we find a system of rows and columns to control the page layout by utilizing a set of CSS classes. Thus, we are considering Grid systems an important part of web designing.

Today, we have a collection of option available for CSS grid systems. Here, we are listed some of the best and most recommended CSS responsive grid systems to use when designing beautifully responsive site layouts with ease.

Flint

Flint


If you are looking for a rapid responsive development, then Flint is a highly advanced Sass grid framework to check out. It is a responsive grid framework that written in Sass and enable developers to create responsive layouts that created on a sophisticated foundation.

Hire on-demand dedicated developers of desired skill & experience.

Jaidee BlueSkyGrid System

Jaidee Sky Grid System


Jaidee BlueSkyGrid System is another popular and lightweight Responsive Grid Framework that is mostly appreciated by web designers.

Crow Grid Framework

Crow


Crow Grid Framework is made standalone that means web designers can easily apply to any of their current markup/web project. It is especially stands for column-row.

Unsemantic CSS Framework

Unsemantic


The successor to the 960 Grid System, Unsemantic is an amazing fluid grid system. It works just like the 960 Grid System, but rather than using a set number of columns, it is based on percentages.

Skeleton

Skeleton


Skeleton is the best collection of CSS files for website designers, who want to create responsive grid layouts. Skeleton delivers you some basic features for dealing with common web layout tasks like CSS reset to normalize CSS.

Neat

Bourbon Neat


Neat grid framework is used to promote clean semantic HTML markup. It uses Sass mixins to avoid additional presentional classes and wrapping div elements. Thinking to use NEAT then get started by reading docs and studying some examples to implement.

csswizardry-grids

csswizardry


Being a responsive grid system’s approach, this framework is all about designing web layouts mobile first. Those web developers, who are concern about populating of markup along with an overabundance of presentational CSS classes, can have an option of Sass’s @extend feature with csswizardry-grids.

Profound Grid

Profound


The best feature about Profound Grid is it precise in rendering fluid grid layouts in all the browsers it supports. They achieve such feat by using negative margins to calculate column dimensions.

Columnal CSS

Columnal


This grid system is the best combination of a couple others with some custom code thrown in. it is an elastic grid while some code are inspired from 960.gs.

Griddle

Griddle


Griddle focuses on the modern browser. It generates by using Sass functions and mixins. It also leverages the powers of CSS inline-block and box-sizing properties that provides layouts to some new abilities that doesn’t provide by traditional float-based layouts.

One% CSS

OneGrid


One% CSS Grid is a 12 column fluid CSS grid system that designed as a base for developing responsive web layouts with minimum effort. When using this system, you don’t have to resize and rearrange your layout for each platform separately.

Proportional Grids

built by Boon


Proportional Grids enables to solve the problem that raised due to rescale our layouts, and disproportionate sizes of gutters between different viewing situations. It enables users to fixed units of measurement and being able to have fluid columns.

Responsive Grid System

Responsive Grid


Responsive Grid System is not a framework or a boilerplate. It is a quick, easy & flexible way to develop a responsive web site.

Herow

Herow is a timesaving Sass grid system, offering mixins that are simple and easy to customize. It’s atomic mixins are best to deal with responsive problematic. Even, users can easily generate atomic classes to play with it directly in CSS.

Gridlock

Formstone


A truly mobile first approach towards website design is showed by Gridlock that reverses the responsive web design media query logic. It helps to improve rendering speed a tad bit on mobile browsers.

Hire dedicated team for your next web development project.

Kube CSS Framework>

KubeFramework


One of the most advanced and flexible frameworks, Kube helps to spend more time on routine tasks and helps to develop fabulous products. It focuses on success and cover technology behind it.

These are 15 best collections of grid resources for web designers to check out. If you are looking for more information about these resources, then visit here.

The post 15 Best Responsive CSS Grid Systems for designing Website appeared first on Perception System.

]]>
How to Develop Java Travel App that Integrates Web Services? https://www.perceptionsystem.com/blog/develop-java-travel-app-integrates-web-services/ Sat, 04 Oct 2014 00:00:00 +0000 https://www.perceptionsystem.com/develop-java-travel-app-integrates-web-services/ Are you thinking to develop Java Travel App? Check out this step-to-step guide that teaches you to develop Java travel application along with integrating web services.

The post How to Develop Java Travel App that Integrates Web Services? appeared first on Perception System.

]]>

Most of the people love to travel and for them, it is must to build travel app that provide instant information about their traveling place. Those developers, who are thinking to create travel application for their users, can see guide in this post.

This guide is divided into two parts. The first part leverages the user preference that stored in a user profile and the second incorporates the first one with external services in a web application.

Things You Require to Build A Same Application

cloud application

Run the app here

Note:

If you are clicking on Run the App, you can able to login with any ID and password. After that, you have to fork the code by clicking the EDIT CODE button in the upper right-hand corner after you click Get the code. If you are not already logged in then enter your DevOps Services credentials for that and have to click on the FORK button on the menu for building a new project. On other side, you have to export the code by choosing the root folder and select File >> Export from the left navigation.

Hire on-demand dedicated developers of desired skill & experience.

Create the cloud application

Here, we are going to start creating the cloud application by deploying the sample on Bluemix. One can choose Java with the Spring Framework for the best result. In addition, one can have to go to Bluemix and select type of application for developing an application. The type of application can be Java Web, Ruby, Java stand-alone, and so on. We are choosing Here, Java Web.

Install and use cf command-line tool

It’s time to manage the application with the Bluemix web interface or the command-line interface that offered by the Cloud Foundry project.
If you are choosing command-line interface cf then it allows deploying, associating service, controlling (start and stop) applications, and more.

Now, download the CLI from GitHub and launch the installer. cf.exe is an executable file that you can see after installation. Firstly, you have to set the target API endpoint and after that sign-in in that.

After that, you can see the list of applications, services, and bound services.

Prepare the development environment

The MVC Spring Framework is used this sample while the Spring Tool Suite uses the environment with the Cloud Foundry plugin. Here, they are using tools and technologies like

  • Spring Tool Suite 3.4.0+ Cloud Foundry Integration for Eclipse 1.5.1
  • Spring 3.1.1
  • JDK 7

One can have to deploy on a Cloud Foundry platform when developing a Java Web Project. Doing this will create the manifest.yml file that shows the application and its resource needs to the Cloud Foundry runtime.

Now, we are parting our application in two different parts.

  • The UserService is the first that exposes the API for managing the user info. An internal cloud platform MongoDB, which is popular NoSQL database, is used to realize the persistence of data.
  • The MyVacations is the second that allows the logged-in user for searching available hotels by using some parameters. The values of some of these search parameters are provided by the UserService. The list and info of hotels are provided by Expedia Services. The list of hotels is positioned by Google Maps API Web Services on a map.

With UserService, you can simple know how to store information about users in a central location by using the MongoDB service. There are two major UserService functions like

In the profiling function, the user name is received by the UserService and searches the user information like number of adults, number of children, location, etc. and returns them to the client.

In The logging function, the user name and password is received by the UserService and searches for the user in the database. UserService returns it, if it finds the users otherwise creates a new record.

Bind a cloud service (MongoDB)

Developers have to create an instance of the service to use a MongoDB service. For that, they have to connect to Bluemix and choose Add a Service in the dashboard view.

Now, you have to choose MongoDB from the list of available services and create the service instance.

If you don’t want to do this then you can use the command line:

cf create-service mongodb 100 mongodb_ser1
(USAGE:    cf create-service SERVICE PLAN SERVICE_INSTANCE)
cf bind-service UserService mongodb_ser1
(USAGE:    cf bind-service APP SERVICE_INSTANCE)

Your MongoDB service instance is ready and bound to UserService.

Use MongoDB service in the application

Once, you have developed the service and have associating it to your application then you have to add its configuration to VCAP_SERVICES as a read-only environment variable that has information which you can use in code for connecting to your service. If you have:

{
  "mongodb-2.2": [
      {
         "name": "mongodb-ser1",
         "label": "mongodb-2.2",
         "plan": "100",
         "credentials": {
            "hostname": "10.0.116.106",
            "host": "10.0.116.106",
            "port": 10192,
            "username": "46c538a6-e6e1-4d02-8132-77b0a4b2dc1c",
            "password": "0ceea0ea-5548-46ad-9b09-1002683aeca7",
            "name": "946dc87b-b455-4d12-b977-1b1ee22f1ade",
            "db": "db",
            "url": "mongodb://46c538a6-e6e1-4d02-8132-77b0a4b2dc1c:
0ceea0ea-5548-46ad-9b09-1002683aeca7@10.0.116.106:10192/db"
         }
      }
   ]
}

Using the VCAP_SERVICES variable, you can simple connect to the MongoDB service instance by extracting “url” JsonNode. All the parameters are contained in the URL that helps to connect the database like host name, port, user credentials, and DB name.

String env = System.getenv("VCAP_SERVICES");
	ObjectMapper mapper = new ObjectMapper();
	try {
		JsonNode node = mapper.readTree(env);
		Iterator<JsonNode> dbNode = node.get("mongodb-2.2").getElements();
		JsonNode cred =  (JsonNode)dbNode.next().get("credentials");
		String uri =cred.get("url").getTextValue();
		logger.debug ("url db: " + uri);
		return uri;
	} catch (JsonGenerationException e) {
		logger.debug(e.getMessage());
	} catch (JsonMappingException e) {
		logger.debug (e.getMessage());
	} catch (IOException e) {
		logger.debug (e.getMessage());
	}
	return null;
}

To create a DB connection, one can create a Spring configuration class by using the MongoDB Java driver, to return the DB object to the client.

@Configuration
public class MongoConfiguration {
	public @Bean DB mongoDb() throws Exception {
		MongoClientURI mcUri = new MongoClientURI(getUrlConnection());
		MongoClient mc = new MongoClient(mcUri);
		mc.getDB(mcUri.getDatabase());
		return mc.getDB(mcUri.getDatabase());
	}

The MongoConfiguration is used by the UserManager class for interacting with DB. Moreover, the “users” collection is received by the init method or can develop if it doesn’t available.

private void init(){
		ApplicationContext ctx =
	    new AnnotationConfigApplicationContext(MongoConfiguration.class);
		db = (DB) ctx.getBean("mongoDb");
		coll = db.getCollection("users");
	}

If we are considering MongoDB as oriented to the document rather than a relational DBMS, it means we have collections instead of having tables, rows (or tuples) than documents and columns than fields. Moreover, such fields are not predefined like the columns in a table. One can easily enter any kind of data in a collection. But, you must create a BasicDBObject to search a document.

BasicDBObject user = new BasicDBObject("username", userData.getUsername());
return (DBObject)coll.findOne(user);

UserController is the UserManager client that is using its functions for getting and saving the logged-in user information.

@RequestMapping(value="/user", method = RequestMethod.GET)
	public  @ResponseBody String getUser(@RequestParam("username") String username,
@RequestParam("password") String password)  {
		logger.debug("BEGIN: controller getUser - username:" + username);
		UserManager userManager = new UserManager();
		BasicDBObject user = (BasicDBObject) userManager.getUser(username, password);
		logger.debug("END: controller getUser - user:" + user);
		return user.toString();
	}

Deploy a Spring application

UserService is used by MyVacations for getting user information to profile the search with the values that the UserService has saved when user last login. The best thing is user can see place resulting from the search.

In the xml config, the controllers are not configured but it detected by the Spring Framework because of directive that included in the servlet configuration file.

<context:component-scan base-package="com.myvacations.app" />

HomeController, which is the first controller used to show the login page.

/**
	 * Simply selects the home view to render login page.
	 */
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home(Locale locale, Model model) {
		return "login";
	}

Upon submission of the login page, the HotelsController is activated and this controller can be also called through an HTTP through the request with the “username” parameter and can also access UserService to get any user preferences that saved while the last access by this user.

The RestTemplate, a helper Spring class for client-side HTTP access, is used by this controller for making a RESTful call to UserService. In addition, the objects are passed to and returned with getForObject() method and are converted to HTTP requests and from HTTP by HttpMessageConverters. With this example, you can know that the class is used for calling the RESTful services, like UserService.

@RequestMapping(value = "/hotels", method = RequestMethod.GET)
public String getHotels(@ModelAttribute("username") String username,Model model) {
	logger.debug("BEGIN HotelsController: username=" + username);
	RestTemplate restTemplate = applicationContext.getBean("restTemplate",
	RestTemplate.class);
	user = (UserData) restTemplate.getForObject(new
	URI("http://userservice.mybluemix.net/userpref?username="+username),
	UserData.class);

Integrate services

If you want to integrate services to bring more data to MyVacations then here are two examples.

  • The Google map service for viewing the hotels on a map.
  • The Expedia RESTful service for showing hotels’ information.

In order to integrate, you have to go to Expedia API Developer for registration in developer’s account and an API key. The Submit button click activates the SearchController is an Ajax call in Hotels.jsp.

$.get('/search',
      $("#ricerca").serialize(),
      function (data, status) {
        if (status == 'success') {
            if (data.toString()==""){
                $("#map_canvas").hide();

We are finding call to the ExpediaClient in SearchController for getting the HotelSummary List.

List<HotelSummary> response=null;
	response = (new ExpediaClient()).getHotels(
			location, dateFrom, dateTo, numAdults, numChildren);

Using the user information that gathered by UserService, the ExpediaClient extracts the ExpediaObjects by decoding the Expedia JSON response.

Listing 1. Extracting a list of hotels

ExpediaObjects hotels= (ExpediaObjects)
restTemplate.getForObject(buildQueryHotelsURL(location,dal,al,numAdulti,numBambini),
ExpediaObjects.class);

A Google map image on your web page is embed by the Google Maps API. One can have to require a specific API key before you start a particular API key from Google. Now the key is free and you have to create a Google account

You have to choose jQuery-ui-map for interacting with the Google maps API. In addition, you have to launch gmap after developing a div or another same HTML container that enable to raise the Google Maps API’s function.

var map =  $('#map_canvas').gmap({
     'center': new google.maps.LatLng(data[0].latitude,data[0].longitude),
     'minZoom': 5,
     'zoom': 8
         });

Now, moving forward, one can have to create a map that focused on the first hotel’s geographic coordinates. Just have to create a marker for every hotel and place it on the map.

$.each(data, function (i, m) {
$(‘#map_canvas’).gmap(‘addMarker’, {
‘position’: new google.maps.LatLng(m.latitude,
m.longitude),
‘bounds’: true
}) .click(function () {…
To load an info window, you have to register a function on-click event with the short hotel description.

$('#map_canvas').gmap('openInfoWindow', {
                                        'content': descr
                                    },

Push the application to the cloud

We are now ready to deploy applications on Bluemix. For that, you have to use the Cloud Foundry CLI cf push command for initiating the deployment.

cf push MyVacations –path MYDIRMyVacations.war

Test the application

Developers have to run a simple run test for testing purpose and to see whether application is portable or not. The access to any user name and password is allowed by the login page. After login, you have to go to ‘Search Page’ and add the search parameters and click Search.

In case, the user is not yet present then it is created.

It is advisable to deploy Pivotal platform and Google App Engine in order to test the portability of the application on different cloud platforms.

Different tools and technologies are used to deploy on GoogleAE such as:

  • Spring 3.1.1
  • Eclipse 4.2+ Google plugin for Eclipse
  • Google App Engine Java SDK 1.8.8

In next step, you have to add Google plugin for Eclipse that adds products to the Run menu for starting the server. The MyVacations installed on Google App Engine in this scenario that calls the UserService application that installed on Bluemix via its RESTful API.

Hire dedicated team for your next web development project.

Various tools and technologies are used to deploy on Pivotal includes:

  • Spring Tool Suite 3.4.0+ Cloud Foundry Integration for Eclipse 1.5.1
  • JDK 7
  • Spring 3.1.1

With the Cloud Foundry plugin for Eclipse, you can easily deploy on the Pivotal platform and thus, test the application on the target environment directly without leaving the IDE. Just you require a valid Pivotal user account.

Application can be deployed by developers on this platform without any change and even, can be deployed the UserService application with minor changes.

The post How to Develop Java Travel App that Integrates Web Services? appeared first on Perception System.

]]>