Samples
Sample Back-end Web Service
For example, the following file is located in the
services
directory.
class MyWebService {
void myWebMethod(JSONObject injson, JSONObject outjson) {
int num1 = injson.getInt("num1");
int num2 = injson.getInt("num2");
outjson.put("result", num1 + num2);
}
}
Note that web services can be added, changed, or deleted on a running system.
There is no registration or configuration needed! Changes take effect immediatly.
No need to bring the server down, rebuild, redeploy, and reboot the server. This very significantly speeds development time. You can also make these changes on a running production system without disrupting existing users.
Also, the system automatically authenticates the call before the method is actually reached.
Lastly, all services are fully compiled by the system and run at full speed.
Sample Front-end Use Of Web Service
The following front-end example utilizes the web service defined above.
const data = {
num1: 22,
num2: 11
};
const res = await Server.call("services/MyWebService", "myWebMethod", data);
if (res._Success) {
let result = res.result;
//...
}
Full authentication and error handling occurs automatically. (The user must have logged in first.)
HTML Component Usage
The KISS front-end comes with a variety of custom built-in HTML tags to make application development easier such as
check-box
,
date-input
,
drop-down
,
file-upload
,
list-box
,
numeric-input
,
picture
,
popup
,
push-button
,
radio-button
,
text-input
,
time-input
.
Many of these are enhanced versions of what HTML already supplies while others are additions to standard HTML functionality.
All are designed to be full-featured business standard controls.
Developers may use any of the supplied tags and may also define their own.
Custom tags may encapsulate any amount of HTML, CSS, and JavaScript code and may be re-used in any number of places.
Kiss also supports tag-less components that can encapsulate arbitrary functionality including pop-up windows.
Database API
Kiss comes with a powerful library for accessing SQL databases.
This API provides the following benefits:
- Automatic connection and statement pooling
- Vastly simpler API than bare JDBC
- Handling of parameterized arguments
- Auto generation of SQL for single record adds, edits, and deletions
- Auto handling for cases of cursor interference on nested queries
- Supports transactions out-of-the-box
- Paging support
Supported Databases
- PostgreSQL
- Microsoft SQL Server
- MySQL
- Oracle
- SQLite
Other databases are easy to add.
Single Page Application
Kiss applications are single page applications in the sense
that there is a single
<body>
tag and all other pages
essentially get placed into that tag on a single page. However,
Kiss is not a single page application in the sense that the
entire application gets loaded with a single
GET
request. This
doesn't make sense for a large business application in which many
hundreds of pages may exist. Kiss lazy-loads pages as they are
used, and except for browser cache, eliminates them once another page
is loaded.