A hybrid approach to Sudoku Maze: Deploying rule applications into the cloud

Source: Internet
Author: User
Keywords Cloud computing apps Sudoku Maze hybrid approach

In this column, I will highlight how to execute the rule application on the cloud. Can WEB applications take advantage of the rules engine that will be deployed to the public cloud? If so, which rule integration patterns will we use? Which ODM components will we deploy? How do we expect to achieve performance levels? What challenges are waiting for us? These are the questions this column would like to answer for two widely used cloud products: Google App engine™ and Amazon Web services™.

This column describes a personal discovery tour that integrates two leading technologies: cloud computing and business rule management systems. Both of these technologies cater to unstoppable forces of change: changes in infrastructure requirements and decision logic. As a long-time researcher on the Business Rules Management System (BRMS), I am curious about the challenges that need to be addressed in developing and deploying rule-based applications on the cloud. We deployed the Sudoku rule set described in part 1th to the cloud to prove the feasibility of using rules on the cloud, with particular attention to understanding the deployment and enforcement constraints that cloud brings. Other areas, such as rule maintenance and licensing, are outside the scope of this article.

Cloud computing (the deployment of web-based applications in an extensible, shared IT environment) is a great strength in today's it world because it offers many advantages over the more traditional application deployment model. These advantages include large-scale scalability, near-real-time availability and equipping, and improved cost management control.

Cloud computing represents a fundamental shift not only for IT administrators, but also for architects and developers. What is particularly interesting from a development perspective is the platform, a service (PaaS), which provides a development environment in the form of a service. In the PaaS model, the cloud provider provides a computing platform that typically contains operating systems, programming language execution environments, databases, and WEB servers. These services are provided free of charge or in the instant payment mode. Application developers can develop and run their software solutions on the cloud platform without worrying about the cost and complexity of purchasing and managing the underlying hardware and software layers. In addition, in many PaaS offerings, the underlying resources are automatically extended to meet application requirements. Examples of PaaS include: Amazon™elastic Beanstalk, Google App Engine, Microsoft®azure, and IBM smartcloud®application Services.

Applications built using the PaaS model run on the provider's infrastructure and are made available to the general public via the Internet from the provider's servers. This deployment model is called a public cloud. Typically, the services available on the public cloud are subject to vendor design and capabilities. Given these limitations, I would like to know if they can be used to develop and deploy rule applications. Which WebSphere ODM components will we use? How should the rule application be packaged? These are the questions I'm going to answer when I build my application and write this column. Here, we'll explore how to deploy a Web application to two popular public cloud services with free daily quotas: Google App Engine and Amazon Web Services (AWS).

Sudoku WEB Application

The Sudoku WEB application provides users with an interface into the Sudoku maze and invokes the rule engine on the server. The goal of Sudoku WEB applications is simple:

the application should be available over the Internet to the general public. The application should use a rule engine at the back end (using the rule set described in part 1th) to resolve the Sudoku. The application should be user-friendly. It should use an AJAX-based interactive front-end to capture Sudoku configurations, display solutions, and step-by-step instructions.

Figure 1 shows the Web application, where it can be found. The top of the illustration shows a screen that allows the user to enter Sudoku data or import this data as a string. The bottom shows the solution screen after clicking Solve using Rules. The list on the right depicts the step-by-step inference used by the rule engine. Clicking any list item highlights the cell corresponding to the inference step, showing the Sudoku solution that is deduced from the current position.

Figure 1. Sudoku WEB Application

The Web application is built using Google Web toolkit™ (GWT), which is a development toolkit for building browser-based, complex applications. The GWT SDK provides a set of core Java APIs and widgets. These tools enable developers to write AJAX applications in Java and then compile the source code into highly optimized JavaScript that can run across all browsers, including mobile browsers for Android™ and iphone®. Here you can find an introduction to the GWT SDK and instructions for installing and using it in Eclipse. I find it interesting to develop GWT applications using Google Plugin for Eclipse.

If you use GWT, all encodings will be done using Java, HTML, and CSS. Application code is divided into server code, client code, and shared code. GWT compiles client-side Java code and shared Java code into JavaScript that can run on any Web browser. Client JavaScript communicates with the server using the GWT remote Procedure Call (RPC) framework, which enables the client and server components of the WEB application to Exchange Java objects over HTTP. The server-side code invoked from the client is referenced as a service that can be implemented using the Java servlet schema. In client code, GWT automatically generates a proxy class to invoke the service to handle serialization of Java objects that are passed back and forth between the client and the service.

It is easy to deploy an application built using GWT to a WEB server. All you need to do is copy your GWT-generated client HTML, CSS, and JavaScript files to the WEB server. Server-side code can also be easily deployed to a servlet container because the GWT compiler creates output in a standard WAR directory structure.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.