2005 2006 2007 2008 2009 2010 2011 2015 2016 2017 aspnet azure csharp debugging elasticsearch exceptions firefox javascriptajax linux llblgen mongodb powershell projects python security services silverlight training videos wcf wpf xag xhtmlcss

Data Feed Framework - February 2007

Back in late 2005 I created a system which I'm now calling the Data Feed Framework (DFF) to greatly simplify the creation of RSS feeds and the aggregation of RSS and Atom feeds on web sites. The goal of the feed creation portion of the system was to allow developers and IT professionals to create RSS feeds with little to no work at all thereby allowing them to use RSS for purposes other than blogging or news. The goal of the aggregator portion of DFF was to the integration of information into ASP.NET 2.0 pages.

The Data Feed Framework has two primary components :

  • FeedCreation
  • InfoBlocks

Using the FeedCreation mechanism, developers and IT professionals can quickly create RSS feeds to monitor internal SQL databases, create sales RSS feeds for management, or monitor whatever else they wanted. The aggregator portion of the system, called InfoBlocks, allows web developers to declare a control in ASP.NET 2.0, give it an RSS or Atom feed and walk away having an InfoBlock on their page containing a list of feed entries for the RSS feed.

The two portions of the system work together, but can also be used separately.

To make explaining this a bit easier, below is a link to my documentation for the system. Below that are the links for the source of the system as well as screen shots. I'll soon be creating a video to go over the basic concepts of this system.

I can't over emphasis how simply this system makes RSS creation and RSS/Atom aggregation. It's literally a matter writing a SQL statement. Absolutely no more work than that is required. The simplicity is very much like that simplicity in WCF. Where WCF relies primarily on attributes and a config file, I rely simply on a SQL Server 2005 table called "FeedCreation". You literally write a SQL statement and give it a name and you have a complete RSS feed ready for corporate or public distribution. I'm planning on incorporating this system into the core of Minima in the next CTP.

The license for this is simple: use it all you want for whatever you want, customize it to your own needs, but 1) ALWAYS keep the copyright notice in there and 2) I nor my companies are liable for anything. The typical stuff...

Update: This project has been renamed to SQL RSS Services and has been updated for .NET 3.5 using LINQ and the syndication feed support in WCF.

Related Links

WCF Relative Binding Speed Demo Updated

Last year I released a simple demo showing the relative binding speeds of the various native bindings in WCF. Since that time, WCF the syntax has changed a bit making my original code obsolete. Now I'm posting the the source code based on the final version of WCF.

Here are the changes I made (most are simply to update):

  • The client proxies changed from "Proxy" to "Client"
  • <service type="..."> changed to <service name="...">
  • The 'mex' binding was added.
  • ServiceEndpoint was moved to System.ServiceModel.Description
  • On the service interface, the ServiceContract attribute ProtectionLevel was set to ProtectionLevel.None so that security is not required, thus giving a more accurate benchmark.

You can use these as a bases for you own services, but you may also wish to look at my XML Assembly Compiler which has a WCF service template. You can simply select the template, perhaps design a few types and interfaces, and let it create your entire WCF project for you.

Links

New XAG Feature - Simplified DTO Creation

After finishing up the first CTP of Minima I have to say that creating my own objects for data transfer (called DTOs - Data Transfer Objects) is painfully lame and using XAG to create an entire projet every thing is a bit overkill. So, I added a middle ground feature into XAG to allow all of us to very efficiently generate DTOs.

So, now, you can go to XAG, select the DTO Class Template (or write your own), select "Single Type Only" and it will show you the class ON SCREEN in a text area for easy copy/paste into your own project. This should make data transfer in the pre-C# 3.0 world MUCH easier.

Here's an example of what you can do.... you simply put the following in (you could have XAG put the DataContract and DataMember attributes on there too-- see the XAG WCF template), select Single Type Only mode, hit Create, and you get the below code instantaneously on the screen. I've been an advocate of AJAX for 8 years now and this should serve as an example of why you should use it too. Link to XAG is below.

<Assembly xmlns:x="http://www.jampadtechnology.com/xag/2006/11/">
    <Person x:Key="Person" Type="Class" AutoGenerateConstructorsByProperties="True" AccessModifier="Public" Namespace="AcmeCorp.Sales">
      <Properties>
        <FirstName Type="String" />
        <LastName Type="String" />
        <Address1 Type="String" />
        <Address2 Type="String" />
        <City Type="String" />
        <State Type="String" />
        <PostalCode Type="String" />
      </Properties>
    </Person>
</Assembly>
using System;
using System.Runtime.Serialization;

namespace AcmeCorp.Sales
{
    public class Person
    {
        private String firstname;
        private String lastname;
        private String address1;
        private String address2;
        private String city;
        private String state;
        private String postalcode;

        public String FirstName {
            get { return firstname; }
            set { firstname = value; }
        }

        public String LastName {
            get { return lastname; }
            set { lastname = value; }
        }

        public String Address1 {
            get { return address1; }
            set { address1 = value; }
        }

        public String Address2 {
            get { return address2; }
            set { address2 = value; }
        }

        public String City {
            get { return city; }
            set { city = value; }
        }

        public String State {
            get { return state; }
            set { state = value; }
        }

        public String PostalCode {
            get { return postalcode; }
            set { postalcode = value; }
        }

        public Person(String firstName, String lastName, String address1, String address2, String city, String state, String postalCode) {
            this.FirstName=firstName;
            this.LastName=lastName;
            this.Address1=address1;
            this.Address2=address2;
            this.City=city;
            this.State=state;
            this.PostalCode=postalCode;
        }

        public Person( ) {
        }
    }
}

Links

Minima Blog Engine February 2007 CTP Released!

Over the past few months I've been getting various requests for portions (or all) of my blog engine. The project was not open or shared source... until now. Having had enough requests, I figured I should finally go back through my code and do the refactoring I've been putting off for quite some time now. I went ahead and did my cleanup, added a few more features, streamlined the API, simplified the code tremendously, fixed up the database a bit, and made a sample application to ship with it. Now I'm finally ready to release this blog engine under the name Minima as a February 2007 CTP. The files are listed below. One file is the Minima solution and the other is the database (yes, RAR only-- I don't do ZIP).

As far as licensing... it's a shared source project. Meaning, I'm going to continue development on it and release new CTPs as time goes on. I have a list of things I want to implement in future releases and I'll be shipping those in future CTPs. The license does however allow for modifications... as that's the entire point! This is a template for you own blog system and you can add to it add to it as see fit. However, please be warned that I'll be releasing new versions in the future. So, you may want to keep track of your changes or communicate with me about them. You really don't want to get into the situation where you say "Oh man... he released an assembly to do exactly what I wanted... uh oh... I rebuilt this entire section... this is going to get sloppy!" Just be careful with your changes. Furthermore, no matter how much you change it, you must put somewhere on your blog that your blog either uses Minima or is based on Minima. Lastly, the disclaimer is the typical disclaimer: neither myself or my company will be liable for any usage in any way, shape, or form of either this application or derivatives of it.

By the way... this is why my blog was flaky lately. I've been doing constant deployments to production, which caused all kinds of problems as this web site was my QA system.

Now, here are the release notes as seen in the ReleaseNotes.xml in the MinimaLibrary project in the RAR. Please pay special attention to the "Technology" and "As a Training Tool" sections as it explains the technology in this application, which I think will serve as an example for each of us in many areas. This is why I'm labeling this entry with so many labels.

Purpose

Minima is designed to give developers a minimalistic template for creating a feature rich alternative to Blogger, Wordpress, and other large-scale blogging systems in manner consistent with the technologies and design paradigms of ASP.NET 2.0, XHTML, CSS, ECMAScript, and the Framework Design Guidelines.

Minimalistic?

Minima is minimalistic in a number of respects. First, does not overload itself with every possible feature in the known universe. Next, it's designed to put extra features as add-ons in an effort to keep the code somewhat maintainable. Furthermore, the primary way of interacting with Minima is a single facade (a class designed to make interaction with the internal mechanics easier) with very understandable methods. This facade is actually the API exposed as a WCF service. Finally, in this release there is no client application; however, as I say, there is a very easy to use API. It should cover most everything you need.

There are also other dimensions to it's minimalism. For example, I put in my mini-exception monitoring system, which notifies me of any exceptions thrown from the web site. I could have used the Application Blocks, but I went the more minimal route instead Be clear on this: I'm a complete minimalist and purist. I refuse to have multiple computers, never put two toppings on my ice scream, hate putting anything on my sandwiches, I never use MODs for games, NEVER wear shirts with logos, and never wear more than 2 colors at a time. I hate stuff that gets overly complex. So, I'm a minimalist and this fits me.

Blog Management Application?

There is no management application in this release. I personally use is a small interface I wrote in WPF, which communicates via WCF to the primary server. It was my first real WPF application I wrote and I wrote it before I deeply understood XAML, so I wrote the entire thing using C#. (Those of you who were ASP/PHP masters before learning ASP.NET and therefore wrote your first project in pure C# without any markup will know what I mean) I'm rebuilding it now in mostly XAML with a little code here and there for WCF interaction.

Having said all that, you can very easily write your own tool. Even still, I find SQL Server Management Studios to be one of the best front-ends ever made.

Windows Communication Foundation

The primary way to communicate with Minima is the MinimaFacade class. This class is used internally to get the information for the web site. It's also what you should use when writing your own management tool. Looking at the class you will ask yourself "Why in the world isn't this thing static!?". I didn't make it static because I wanted to apply a ServiceContract interface to it thereby giving it exposure as a potential WCF service. The web site, however, does use it statically via the MinimaFacadeCache class. Anyway, the point is, you can easily write your own remote management application using WPF, Winforms, or ASP.NET 2.0 by using WCF. Of course, if you want a secure channel with WCF... that you will have to add on your own as I didn't have an SSL certificate for testing purposes.

Potential Future Changes

There are some things I would definitely like to change in future CTPs of Minima. I have an entire list of things I want to either change, fix, or add. More information is forthcoming.

Primary Features

The primary features in Minima are just the ones that I just HAD to have. If I didn't absolutely need the feature, I probably didn't add it (but may in the future!) A few things I needed are: "fake" paths or archives and labels, "fake" URLs for each blog entry, multiple "fake" URLs for each blog entry (some times I have a typo in a title of a blog entry, but by the time I find out the blog entry is already popular--so I can't merely fix it-- I need two URLs to point to the same thing), almost completely database driven (including URL mappings), labels (not folders!, I wanted many labels per blog entry), pure CSS layout and style, pure XHTML structure, and the ability to add, remove, or change a major feature on a whim! Now that last one is very important... if I want to change something, I can. This ability came in handy when I went from blogger to my own engine and in the process lost my automatic technorati ping. That's something I quickly added though.

Technology

The DAL was generated using LLBLGen using Self-Servicing template in a two-class scenario. Everything was written in C# 2.0 using ASP.NET 2.0 with a few bits of custom AJAX functionality (I didn't want to use Atlas on this one). All style and layout is CSS as only people who are in desperate need of getting fired use tables for layout. The technorati ping functionality is based on an abridgement of my XML service framework. The RSS feed creation abilities is actual a function of the RSS.NET framework. I would have added Atom, but I've had majors problems with the Atom.NET framework in the past. Finally, the database is SQL Server 2005 (Express in my case), using one stored procedure (which I would like to refactor into LLBLGen).

As a Training Tool

One of my intentions regarding Minima is to use it as a sample application for .NET training. For example, this is a great way to demonstrate the power and capabilities of HTTPHandlers. It's also a good example of how LLBLGen can be effectively utilized. Furthermore, it also demonstrates how you can quickly and efficiently use WCF to turn a simple facade into a multi-endpoint service. It also demonstrates manual AJAX, CSS themeing, HttpWebRequest, proper use of global.asax, framework design guidelines, and type organization.

The API

For now, just look at the MinimaFacade and everything should become apparent. I'll be posting API samples in the future. See the Samples section below for some examples on using the API.

Update: Minima is now in the NetFXHarmonics Subversion respository at http://svn.netfxharmonics.com/Minima/tags/.

Strange SQL Server Column Names

OK, this is strange stuff... Today I was working with Frans Bouma on an LLBLGen problem I was having and we both came to an interesting realization that surprised us both. This sample table should explain it...

create table Cursing (
[@)^!@*&%';] int primary key identity(1, 1) not null,
[%!@#$%%%] varchar(20),
[\234@#$+_!@#$=] bit,
[@#%*@#$%#$%%] datetime,
)

That actually works!

We actually found a column with an odd name similar to the above in a table in a database at the company I work at. The table literally had a column named "%". Seriously. I'm only partly surprised as the table in question was created my Microsoft Navision 3.x. That thing has some REALLY weird table names... and now I see it has even weirder column names.

Why in the WORLD can we have weird characters as field names? Who in the WORLD requested that feature? Why? That's partly rhetorical, but it seriously makes me wonder!

Powered by
Python / Django / Elasticsearch / Azure / Nginx / CentOS 7

Mini-icons are part of the Silk Icons set of icons at famfamfam.com