Friday, August 26, 2005

Im back

I’m back
So after a long break due to getting married, and business I am back on the blog.

Sunday, April 24, 2005

ASP.NET 2.0 ~ A Winner

Week 1
Well, week one developing with ASP.NET 2.0 Beta 2 is in the books. So far, I am extremely impressed. It is finally possible to separate code from content; to develop in an object oriented manner on a web application.

Let's face it, developing web applications thus far has looked as much like developing an application, as developing in Apple Basic resembles developing in C#. Up until now, despite the best efforts of ASP, ASP.NET 1.1 and PHP, it has had more to do with scripting that objects.

With the aforementioned languages, it was most definitely possible to create robust web applications and even to do it in an object oriented manner, but when you got down to the brass tax it was still a scripted language.

I have been coding for 15+ years and I can tell you it has been exciting to watch the emergence of each one of the languages I have learned. I like many developers enjoy learning new languages, especially languages that allow you write elegant code. Of course, elegance is in the eye of the beholder but the language must still allow it.

ASP.NET has all but bridged that gap between writing a Windows Forms application and a Web Application. Extensive event handling, rich UI elements, a strong security model, great database connectivity, Master Pages for consistency, and the new adaptive rendering model guarantee ASP.NET's opponents will reconsider using this formidable platform.

I should mention, that the .NET Framework 2.0 (Whidbey) in generally is as vastly improved as ASP.NET is in this release. I am impressed with the changes made to this wonderful language. I know that many developers are not happy with some of the new coding semantics introduced by generics and some of the other changes. To those persons, obviously more C# developers thought the benefits outweighed any akwardness related to familiarizing oneself with these new constructs.

To the C# team, great job!

Tuesday, April 19, 2005

Arena Wars || Official Website

C# Game Development

There has been continual debate as to whether or not C# could be used effectively and efficiently to develop a AAA game on top of the .NET platform. The C/C++ die-hards are convinced that it is not possible because of the fact that C# is a managed language.



Well, C/C++ eat your hearts out. A consortium of German developers has created a game called ArenaWars. It is a RTS (Real Time Strategy) game and it totally kicks ass. Below is the link to the official web site, where you can download a fully playable demo. The demo features on-line multiplayer gameplay, as well as tutorials, and single player missions.



Good job guys!

Arena Wars || Official Website

Saturday, April 09, 2005

Uggh! Major Computer Issues!

So today started out like any other day. My computer, which is by no means new, starts freezing up intermittently. The old mouse stops moving scenario. At first, it's just a few seconds. A few minutes later its 20 seconds... An hour passes it's 30 seconds. By 3:00pm the computer decided that it had had enough hours of Tribes 2, Visual Studo, MX Studio, and of course DVD movies. It made a sound unlike any I've ever heard one of my computers make. Kind of a woosh mixed with a buzz. I have tried demonstrating the sound for some of my friends and either they aren't impressed or I am just not doing it right.

With the work-load on my plate right now, I couldn't just sit there. I called my business partner Aaron, and we talked it over. First was to repair the computer. Was it worth it? It's been on the path of slow demise for awhile, and it's 2 or 3 years old. With the price of computers these days, we decided to get a new one.

I found myself an open-box (bought and returned) Sony Vaio Widescreen. 3.06GHz. This thing kicks ass. 802.11b/g built in. I am sitting on my couch writing this blog entry. How cool is that?







Wednesday, April 06, 2005

I speak! Yet again...

Web site updates
I am currenly migrating my entire I/T Infrastructure for Webglimmer to a Windows 2003 Server. As such, my entire Seth Webster web site is down since I host my web site on the business box.

I will be using this blog as my soap box for the next month or so, until I have time to put the site back up. I've had this blog for awhile, but haven't really used it.

Thanks for stopping by!

~ Seth

Saturday, January 22, 2005

C# Plugin In Architecture

Introduction
I have recently started developing an application for a client that allows them to manage various parts of the database that we built for them.

I am developing the system so that it is auto-updating and also completely plug-in based, in that the application is basically only a stub that loads the plugins.

I developed it this way for the obvious reason, that since the database and the requirements will be quite fluid, and changing all of the time, I wanted an easy way to roll out changes to them without compromising the original intent.

Interfaces
I developed the plugin system using a base of interfaces to define the contract between the plugins and the host application. In this manner, we can create a concrete definition of what the application expects from the plug in, and what the plug in can expect from the application.

1. IPlugin

namespace NPIMSPI
{
///


/// Summary description for IPlugin.
///

public interface IPlugin
{
void Initialize(IPluginHost host);
string Name
{
get;
set;
}
PluginTypes Type
{
get;
set;
}

IPluginHost Host
{
get;
set;
}

string Author
{
get;
set;
}

string Version
{
get;
set;
}

void Show();

System.Windows.Forms.UserControl MainInterface
{
get;
set;
}
}
}

This interface defines the base interface from which all plugins will inherit. You can see that it provides a method for Initializing the plugin (Initialize()), a method to Show the plugin (Show()), and 6 get/set definitions for various properties.

One notable get/set definition is the MainInterface definition. This is the get/set method that will tell the host application what component to add to the plugin container (in this case a tab control). More on that later.

2. IPluginHost


public interface IPluginHost
{
void Register(IPlugin Plugin);
void SwitchMenu(System.Windows.Forms.MainMenu Menu);
string Request(string Method,NameValueCollection Arguments);
string Request(string Method,string Argument);
string Request(string Method,string Argument,bool CloseOnComplete);
string Request(string Method,NameValueCollection Arguments,bool CloseOnComplete);
void Stop();
void Stop(string Message);
PluginCollection AvailablePlugins
{
get;
set;
}
void CloseWebServiceForm();
}


This interface is inherited by the host application. It defines the methods and properties accessible by the plugins. The request methods are there since the plugins communicate through that application to a web service which provides XML results to queries by the plugins. Again, we'll cover this a bit more later.

Enum - PluginTypes
This enum is simply allows for the plugin to tell the host application what type it is. This is used for when the host application registers the plugin. There are three types at this time; Menuitem, Tabitem, ButtonItem.


namespace NPIMSPI
{
///
/// Summary description for EnumPluginTypes.
///

public enum PluginTypes
{
Menuitem,
Tabitem,
ButtonItem
}
}

PluginBase
I decided that since most plugins will require much of the same functionality, that I would build a base class from which plugins would inherit. Appropriately named, PluginBase.
namespace NPIMSPI
{
///
/// Summary description for PluginBase.
///

public class PluginBase : IPlugin
{
#region Private Members
string name;
PluginTypes type;
System.Windows.Forms.UserControl mainInterface;
IPluginHost host;
string version="0.0.0.0";
string author = "undefined";
#endregion
public PluginBase()
{
//
// TODO: Add constructor logic here
//
}
#region IPlugin Members
public virtual void Initialize(IPluginHost host)
{
Console.WriteLine("Init "+this.GetType().ToString());
this.host = host;
}
public string Name
{
get
{
// TODO: Add PluginBase.Name getter implementation
return this.name;
}
set
{
this.name = value;
}
}
public NPIMSPI.PluginTypes Type
{
get
{
// TODO: Add PluginBase.Type getter implementation
return this.type;
}
set
{
this.type = value;
}
}
public virtual void Show()
{
this.Show();
}

public IPluginHost Host
{
get
{
return this.host;
}
set
{
this.host = value;
}
}

public string Author
{
get
{
return this.author;
}
set
{
this.author = value;
}
}
public string Version
{
get
{
return this.version;
}
set
{
this.version = value;
}
}
public System.Windows.Forms.UserControl MainInterface
{
get
{
return this.mainInterface;
}
set
{
this.mainInterface = value;
}
}
#endregion
}
}


The PluginBase is the base class for most plugins, and as you can see inherits from IPlugin. I've implemented the IPlugin members, and created private members to store the information. I've also left the Show(), and Initialize(IPluginHost host); members virtual so that they may easily be overridden.

method Initialize(IPluginHost host)
This method is called as the host application loads the plugin. It passes a IPlugin host to the plugin, so that 2 way communication can be implemented.