Wednesday, April 29, 2009

Bug in Weborb 3.6 for .NET prevents WDMF from generating server code

Here's an issue that could cost you lots of troubleshooting time to fix. While weborb is a stellar product IMO it is lacking in thorough support docs. Probably that is fine since a commercial client can purchase phone support, but I digress. The problem aka bug aka omission I refer to in weborb 3.6.0.3 results in:

Code Generation Failed

This is the result of an attempt to generate the all-important client-server serialization classes that weborb builds. The client classes are downloaded from the weborbconsole while the server classes are written to the bin directory assuming your permissions are properly set to allow this.

Permissions are easily set via Windows IIS or your webhost control panel. Permissions are also easily reviewed from your website of interest thanks to the diagnostics.aspx page provided. Potential issues are even coded red. Easy enough.

Problem is essentially the result of a wishlist item added to Weborb 3.6 and released 12/02/08, Visual Studio templates. I didn't even expect to find them, but did so and began enjoying the ease of deployment templates offer. Only problem is, they won't work unless you add the XSLT files in the ODBC directory from the original full vers of weborb30.

I tried other stuff for a while to fix the prob, then finally read the error text logs on my deployment and discovered the omission. As stated before, Weborb is the Barry Bonds of remoting, a real slugger for joining up RIAs for web and I can't say this enough. The fact that I could rely on the framework tools to hunt down the error and fix it is one reason why. Now, has anyone else had this problem? If so, I hope this helped.

Fig 1. Diagnostics aspx page for weborb









Fig 2. Creating a weborb-enabled website in Visual Studio 2008 using the weborb-provided template











Fig 3. The missing odbc folder, where it should be









Fig 4. What you should see if all goes well in the weborbconsole WDMF

Wednesday, April 8, 2009

SQL & LINQ for n-tier applications

As I've blogged a lot lately, WebORB bridges back end and presentation servers for AMF and DB CRUD functionality. Furthermore, once WebORB is configured properly, it deploys server and client code in an automated fashion, allowing this to happen. If you manage to rig it properly, it binds your data via method calls to the DB.

In developing an n-tier application, it's crucial to plan in advance how the tiers will provide for one another in the overall application chain. Justin J. Moses' blog of March 19th outlines the strength of utilizing SQL with LINQ in such a way. I especially enjoyed his definitions of generalized data transfer strategies as being either safety, hungry, greedy, or thrifty. Well done!

Since his description is more than adequate I won't go into it here, but seeing as it's a likely fit for my current project, I may post some notes later on data across the pipe with RIA.

ASP.NET MVC is the last gasp

I started web development with open source as long as 10 years ago. Then it was PHP on an Apache server and I've continued through PHP 5 creating everything from mySQL databases to custom frameworks and CMS. Not too long ago, a new client project required ASP.NET technology, so I learned how to use .NET too. Here are some pros and cons.

Pros: Lots of documentation. Large developer community. Many adopters in the corporate realm.

Cons: Several. One particular blog I found nailed the issue. It's a matter that parallels the PC vs Mac debate. In more abstract terms, it's a question of

Goal-Oriented vs Process-Oriented

Stripping away the layers of good arguments on all sides, I have found Microsoft solutions tend to favor process over goal orientation. That's not good for independence and it's not good for speed.

A specific example.
You're a developer intent on deploying a web application quickly using whatever tools are best.
With Apache and PHP, the process is contained discretely within the server environment.
With Windows and .NET, there is a ripple effect requiring the expertise of the IT department. You need to know all about system permissions, a great deal about SQL management. Really, lots of peripheral management issues come to drag your process to a crawl.

That aside, there are a lot of smart people using .NET, and I'm interested in learning more about quick ramp-ups for .NET solutions. I'm a fan of Visual Studio's GUI and the xml DataSet system in .NET. I only wish they were quicker to adopt the DRY principles of RoR in their framework.

Since most of my clients fall into the small to medium category, unless they are running 100% enterprise solutions, I recommend a PHP or RoR orientation.

I will still be looking at .NET MVC resources to see what they've done to address quicker CRUD deployment. It begs the question, what open-source solution will Microsoft roll out years after the competition next? That is why edgy developers tend toward Apple and Open Source.

Monday, April 6, 2009

SQL Schema Backups

I've got plenty of ebooks, some of which I've looked over, some not so much.

In general, due to over-verbosity, ebooks are a next-to-last ditch effort. I consult the ebook when the following has failed (usually in this order):
  • Relying on past experience
  • Googling for answers
  • Regoogling with site-specific filters and phrases
  • Trying bundled help files of application in question
  • Forums
  • Possibly contacting a help desk via online chat window
Finally...the ebook. If an issue gets to this point, I'm up the creek.

Problem with forums is, they're often vague and fragmentary. I'm not knocking - just looking for a little more meat on the bone.

The best answers are brief and demonstrative with plenty of screenshots. Bonus points if the writer is being engulfed by a green jellyfish.

Friday, April 3, 2009

WebORB : words from the author

Hear WebORB principal and lead architect Mark Piller talk about his product on theFlexShow.

What I found interesting:
  • Detailed description of the AMF (Action Message Format) binary data protocol
  • WebORB Business model is set up for small to medium businesses*

Good question by host "Why have AMF when there are other options?"

All options based on the HTTP(rotocol). The three basic options are HTML, Web services (SOAP, JSON, etc) and Remoting. One differentiator with Remoting and consequently AMF is its performance advantage. Another is the rapid data transmission it offers. Finally, security is a big part of it. Methods in Html and Web Services require security metadata, such as lock and key pairs, ciphers and such, so that if packets are intercepted, they cannot be compromised. Remoting on the other hand has easier security management. The container is running on the server side, so it is responsible for serializing the data before it is released into any security-sensitive zone. Interesting considerations.

Podcast has more.

WebORB Synopsis Pt. 1


WebORB by themidnightcoders, aka Dallas-based Mark Pillar and company, is a software application designed to facilitate and ease RIA remoting. Over its livespan, WebORB has grown to its current ambitious version (3.6) to become a sophisticated multi-tool of sorts, providing a broad range of services for a pastiche of server types.

How does a product such as WebORB come to be? Weborb is in fact one among a stable of solutions (amfphp, swx, BlazeDS, RubyAMF, LiveCylceDS et al) initiated to bridge the expanse between server side and client side in rich applications. The options in this lineup range from Open source and free to commercial and costly, from single protocol to advanced suite. WebORB among them could be said to toss the biggest lasso.

WebORB marries server technologies .NET, PHP, Rails and Java to presentation server clients Flex, Flash, AJAX and Silverlight. It allows the server side to do what it does best - provide a data bank and administration, while allowing the client to benefit from a live data source. There's a lot more on offer than simple connectivity, however.

WebORB can be deployed in modular fashion to an existing web application. Once integrated, it includes a proprietary console GUI to demo its many capabilities. As is explained in the console, WebORB offers three broad categories of connection services:
  1. Remoting (AMF3)
  2. Data Management (WDMF)
  3. Real-time Messaging
Among these, it is fitting to begin with remoting, as remoting was the initial goal of applications like WebORB. In its maturity as a service, invocation of remoting is bidirectional, fully interoperable, reflexive and essentially transparent. In addition to basic transfer of assets, WebORB remoting includes class mapping, secure channels of invocation, tree control with remote data, server-side exception handling, logins and security, and supports ARP, an open source framework for Flash and Flex initially authored by Aral Balkan.

WebORB effectively encapsulates the full capabilities of Flex Remoting, and in so doing, it lays bare the limitations of Remoting. Namely, that shuttling large serialized datatypes between environments is crude. It results in a loss of organizational nuance, such as hierarchies, relationships, dependencies. Put another way, the schema is not transferred with the data, and thus the sorting abilities that are the inherent value of a data system are lost. Data Management can be viewed as a means of addressing this limitation.

Data Management, aka WebORB Data Management for Flex or WDMF, is a means of preserving the relationships surrounding remote data between server and client sides. In a nutshell, WebORB imports table relationships directly from the server database and utilizes its own innovative analytical methods to create all the necessary interoperability through scripts it generates for both sides. In this way, WebORB enables explicit relationships to exist through a generative act of surrogation. In short, it analyzes, it marries, it step back into the shadows. Not bad, Midnightcoders, not bad. An invaluable utility and a tremendous time saver, Data Management also includes full CRUD, enabling the rich client to act as CMS if desired.

Real-time Messaging is another facet of WebORB to be explored later. Feel free to visit themidnightcoders site to learn more.

Adios for now.

Wednesday, April 1, 2009

httphandlers and asp.net

HTTPHANDLERS

They're a critical link in remoting, such as between a .Net application and a Flex presentation server. They can also be customized for other uses, such as dispatching synchronous or asynchronous data. Once you break the seal on httphandlers, you will likely discover they are profound in their utility.

This example demonstrates how to use HttpHandler technology using Asp.Net2.0 and C#.NET

This tutorial only uses the default namespace. The System namespace contains the EventHandler.

HttpHandler is a class that implements the IHttpHandler and IHttpAsyncHandler interfaces. This section describes how to create and register HttpHandler and provides examples of a synchronous handler, an asynchronous handler, and a handler factory.

First, you need to create a classlibrary HttpHandlerDLLVB. The code as follows:



using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace HttpHandlerDLL
{
public class MyHttpHander : IHttpHandler,IReadOnlySessionState
{
public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
context.Response.Write("<h1><b>HttpHandler Test</b></h1>");
context.Session["Test"] = "Invoke a session in HttpHandler.";
context.Response.Write(context.Session["Test"]+"<br>");
context.Response.Write("<a href='HttpHandlerCsharp.aspx'><b>return</b></a>");
}
}
}

Then create a website project and reference classlibrary HttpHandlerDLLVB.dll.

At last configure your web.config as follows.

<httpHandlers>
<add verb="*" path="ViewHttpHandler.aspx" type="HttpHandlerDLLVB.HttpHandlerDLLVB.MyHttpHandlerVB,HttpHandlerDLLVB"/>
</httpHandlers>
The front end HttpHandlerVB.aspx page looks something like this:

<a href="ViewHttpHandler.aspx">Test HttpHandler</a></p>
</div>
The flow for the code behind page is as follows.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}