The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Widget interface

We want to offer a really clean simple widget xml interface to our service, where servercode is permitted to execute.
(There is danger in that, but we have that part covered)
This is a work in progress, and we are trying to figure out better and easier ways to do this all the time.

The api is defined as a serverscript by the author, and the access from the client to it is by default ajax, and is triggered by (any number of) events, like onclick, onload, etc..
The serverscript has the exact same range of access to the inline elements as clientside dhtml, including style/css.
There's basically no need for clientside jscript for anything one wants to do.

The question is whether there are ways to further simplify this, making it quicker to work with?
Any comments on that, what we should change or add, would be greatly appreciated.
(If you dont like ajax or xml, period, point taken - dont mind this post)

Below is a calculator example.
Code put in the serverscript block has unrestricted access to the server and it's internal database/objects, making it easy to create an email application or similar this way.


caption="A simple calculator"

function setSum(str)  {
var d=myIDresult.text;

function getSum() {
var d=myIDresult.text;

function clearSum() {

#myRef table{margin:10px;margin-left:auto;margin-right:auto;}
#myIDresult{color:white;background-color:black;border:silver 1px solid;width:100px;height:20;text-align:center;margin:2px;}

<table border="0" cellpadding="0" cellspacing="1">
<tr valign="top">
<td align="middle" id="myDtarg" colspan="4">
<button id="myIDresult">
<tr valign="top">
<td load="setSum(1)" box="myDtarg">1
<td load="setSum(2)" box="myDtarg">2
<td load="setSum(3)" box="myDtarg">3
<td align="right" load="setSum(0)" box="myDtarg">0
<tr valign="top">
<td load="setSum(4)" box="myDtarg">4
<td load="setSum(5)" box="myDtarg">5
<td load="setSum(6)" box="myDtarg">6
<td align="right" load="setSum('+')" box="myDtarg">+
<tr valign="top">
<td load="setSum(7)" box="myDtarg">7
<td load="setSum(8)" box="myDtarg">8
<td load="setSum(9);" box="myDtarg">9
<td align="right" load="setSum('-')" box="myDtarg">-
<tr valign="top">
<td load="setSum('/')" box="myDtarg">/
<td load="setSum('*')" box="myDtarg">*
<td load="clearSum('.')" box="myDtarg">CE
<td align="right" load="getSum()" box="myDtarg">=


Mikael Bergkvist Send private email
Tuesday, July 11, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz