Donald King's Blog

Implements IQuestionable

  Home  |   Contact  |   Syndication    |   Login
  3 Posts | 0 Stories | 3 Comments | 8 Trackbacks

News

Archives

Post Categories

AgileWise Articles

Technology Links

Tuesday, July 12, 2005 #

I am trying to get the Ajax.NET library working against DotNetNuke. If you have had any luck in doing this, please share your experience. It seems that as of right now, DNN is not very conducive to working properly with the library. I think this may take a little work(around) ;-).

On another note, this blog post was of interest to me. The author of Ajax.NET has posted that his project is now open source. If you go to the sourceforge.net project site for this library you will see that in fact there is no source to be had. Now, let me first say hats off to Michael for building a great component and providing it for free to the public. Where the crux lies, I believe, is that in his post concerning the transition to open source he states

"Update: Now, the project is running at sourceforge.net. I am uploading files and then... you will be able to see the source code."

You will notice there are about 80 comments to his posting and several of them are irate that he has not posted the source and has instead only posted the assembly for use; along with sample code and documentation. What I believe is occurring is that he will in fact post the source code but is presently working to clean it up and ensure that things that may have been written inefficiently are "corrected" for when the source gets released to the wolves and they (the development public) start to tear it apart line by line (limb by limb). Give the guy a break and give him a chance to make his wonderful project pretty before he post it for the world to see. And Michael, if you are reading this, you might just want to post an update of where that is at. You have a big following for a great library and now you are on the hook to deliver ;-) Good luck my friend!

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Wednesday, July 06, 2005 #

I recently saw this article on TheServerSide.NET and thought it was a very well written article on AOP implementation with .NET. The author also did a nice job of discussing the basics of AOP including terms associated with and the overall purpose of the paradigm. A very long time ago I had come across an introductory article in Software Development magazine that focused on AspectJ. Touted as the the world's first Aspect-Oriented compiler, it seemed (at least to me) to speak of the next revolution in software design to come. The author even quoted:

“Mark my words, aspects are going to cause an epochal shift in programming right up there with the object shift of a decade ago”

I immediately went to the project web site, downloaded the compiler and did my first “Hello World” using aspects. I was fired up and fascinated at this new idea and at the time was still fairly heavy into Java in my alternate life. I ended up entering into the Masters program at the University of Kansas under the School of Engineering to pursue my graduate degree. Needless to say, I had to drop out (here come the excuses) because my son Jonathan came along and he takes up all of my spare time and I love it. I wouldn't change a thing about that. Another issue was the drive over to the Edwards Campus in Kansas City in the evenings I had classes, three hours in the classroom and then a drive back to Topeka. I usually would get home close to 12:00 A.M. on those nights. Just a bit too much for me so I left the program. Anyway, I digress, my point was going to be that I ended up focusing on Aspects for my thesis work that I did while I was there. This included research and production of a term paper on AOP for my Object-Oriented Software Engineering Class (EECS 816?). While researching I came across a posting by John Lam who runs iunknown.com. Here is the post reproduced at Sam Gentile's blog. For some reason it seems that John has removed the resource from his web site. The posting was in regards to a tool John had been working on called CLAW (Cross Langauge Aspect Weaving). In the posting John discusses his wavering support for AOP and points out what are glaring shortcomings centered mostly around the idea of unintended side-effects and oblivious behavior. To give you an idea of what that means, suppose that you were debugging an application and someone was interjecting an aspect into your method (before, during or after) based on its signature. So for example, everytime you called the ToString() method an aspect interjected and provided behavior you have no control over or have no need for. In most respects this might be something more along the lines of logging or security checks but you can see how this could be dangerous. From an unintended side effects perspective the idea is basically the same and I guess could be considered somewhat synonymous. For instance, if a conditional operation is short circuited, and one of the operators is a method, an aspect might be injected (or fail to be injected) and the uninteded side-effect occurs. Of course Lam does not propose that AOP is a completely lost cause but as he says:

“I believe that AOP, as it stands today, is too complicated to use as a general-purpose development methodology“

He also goes on to mention how many of these problems might be solved by a good IDE.

The point to all of this is that it really took the wind out of my sails and made my thesis work seem somewhat pointless. I am encouraged by some of the seeming ressurgence of AOP I have seen lately in the community or at least interest if nothing else. It has sparked me to pick back up the AOP book if you will and keep reading.

Please let me know your thoughts or any experiences you have had with AOP. I would love to hear them.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Monday, July 04, 2005 #

I have been trying to solve a little problem I have with controlling the serialization of a class I have inherited from CollectionBase to create a strongly typed collection. The class that drove the need for my strongly typed collection is of type HeadlinesArticle and the collection class is HeadlinesArticleCollection:
 
 
[XmlRootAttribute("Article")]
public class HeadlinesArticle
{
...
}
 
[XmlRootAttribute("Article")]
public class HeadlinesArticleCollection : CollectionBase
{
...
}

As you can see in above code, I have decorated the HeadlinesArticle class so that the serializer will write out 'Article' as the root. It works fine and produces exactly what I need. The HeadlinesArticleCollection class is somewhat different. As many of you know, the default serialization behavior for this type of class is to output something similar to this:
<ArrayOfHeadlinesArticle>
...
</ArrayOfHeadlinesArticle>
To change this behavior, I had to create a new System.Xml.Serialization.XmlRootAttribute and provide what root element I want the Serializer to use. Here's an example where 't' is of type HeadlinesArticleCollection:
 

serializer = new XmlSerializer(t, new System.Xml.Serialization.XmlRootAttribute("Articles"));

This is all fine except the Serializer ignores the root attribute decoration I placed on the HeadlinesArticle class and so instead of this:
<Articles>
<Article>
...
</Article>
<Article>
...
</Article>
<Article>
...
</Article>
</Articles>
I get this:
<Articles>
<HeadlinesArticle>
...
</HeadlinesArticle>
<HeadlinesArticle>
...
</HeadlinesArticle>
<HeadlinesArticle>
...
</HeadlinesArticle>
</Articles>

Obviously the Serializer is ignoring the root attribute I placed on the HeadlinesArticle class. So I tried using the [XmlElement] attribute on the indexer of HeadlinesArticleCollection class but it basically has no effect at all:
 


[XmlElement("Article")]
public int IndexOf( Article value )  
        {
            return( List.IndexOf( value ) );
        }

So my question is, does anyone have an idea of what I can do to get the behavior in serialization I need short of renaming the HeadlinesArticle class to Article? Renaming the class is of course a work-around but I sure hate to think that I can't name my classes what I want.

One other caveat is I considered implementing the IXmlSerializable interface which I have done before and it works but I feel I should not have to go to that length for this. Any help is appreciated.

DK

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati