Jim Lavin

Its all 'bout re-use

  Home  |   Contact  |   Syndication    |   Login
  18 Posts | 0 Stories | 7 Comments | 0 Trackbacks

News

Twitter












Tag Cloud


Archives

Post Categories

My Other Blogs

Tuesday, November 04, 2008 #

I am proud to present the first episode of Industry Vertical the twice monthly net cast about industrializing software development with Software Factories, Guidance Automation and Domain Specific Languages at http://tinyurl.com/6gjlgl. This episode starts out with the basics of Software Factories and trys to answer the question "What is a Software Factory".

Sunday, August 24, 2008 #

I just posted a new blog article at http://tinyurl.com/5po2mw


I just posted a new blog article about sending my daughter to college and our trip to Portland, OR at http://tinyurl.com/5vrynn


In an effort to consolidate all of my various web sites and blogs into a single location I have moved my blog to http://www.jimlavin.net/blog/

I will continue to post links to new posts for the next few months so everyone can update their links.

 

Thanks


Monday, July 28, 2008 #

So, I'm happily plugging along, adding the ability to import a WSDL file into one of the DSLs for a new Software Factory we're building at work. And after reading and re-reading the documentation and the DSL Book, I decide I need to call store.Dispose() in my code because I'm finished adding ModelElements to the model and I am leaving the command handler. You know, be neat and tidy when you exit a function dispose of any COM+ interfaces you've might have AddRef'd, etc.

So now I'm running the DSL and everything is working like it did before my single line of code, but now after adding the ModelElements to the model POOF! my model explodes! and I've lost everything in the model. I try it again a couple more times, kinda like pushing the car back up the hills to see if the brakes will fail for a second time after they did the first, you know typical programmer mentality and sure enough POOF! POOF! POOF! it keeps doing the same thing over and over.

So I trace through the code and notice that after I execute the store.Dispose() and exit the function, I get rerouted to the DocData class and it is trying to save the file and throws an Exception because the diagrams no longer exist.

So I go back and review my code and notice that I am not creating a new store and loading in the model, but I'm using the existing store that is opened by the DSL Editor and when I call store.Dispose(), I'm pulling the rug out from underneath me, the editor and Visual Studio as well.

So, I removed the single line of code that caused me an hour's worth of grief and everything is working just hunky dory.

I guess it will always be engrained in my head, that unless I'm actually creating the store, I shouldn't be disposing of it ,otherwise I'll cause terrible things to happen.

Hopefully this will keep the rest of you from making the same mistake I did.


Saturday, July 05, 2008 #

So it has been 30 days since I turned off the cable to the house and started watching nothing but technical content that I could pull from the Internet. A lot of my friends kept waiting for me to move back into my parent's basement since they felt watching so much Tech would turn me into the ultimate nerd. Luckily that did not happen, but I didn't completely watch just technical stuff the whole thirty days. I would say that my daughter put up with it for about two weeks and then she demanded that I at least get something she could watch that did not have to do with technology.

I will have to say that there are a lot of video web casts and on-demand services available on the Internet that have nothing to do with technology, the good ones are few and far between and many of them I will never understand, but they are out there. So in order to meet my daughter's demands I ended up with a combination of solutions to get content into our Vista Media Center PC so she could enjoy herself.

First I hooked into the various movie services, NetFlix, Vongo, CinemaNow, ShowTime, etc. Many provide VMC plug-ins that you can download directly from within Media Center or a plug-in is available from a third party. The best I've found so far is the vmcNetFlix plug-in. It provides you the ability to watch NetFlix videos from within Media Center. It provides a great user interface that lets you browse all of the genres and available titles provided by NetFlix's WatchNow Service. You can either watch the title instantly, move it to a queue for later viewing or download it in the background to watch at another time. Like many of the movie services NetFlix costs around $10 a month to have access to unlimited viewing but It's well worth it.

The biggest comment I have here is that we are starting to see these type of services spring up all over the place but mostly are for only viewing via a browser. With the cost of video technology dropping like a rock I expect we are going to see more set top boxes that will provide broadband based on demand services within the next two years. I am surprised that someone hasn't started a company to help the various broadcasting companies bring their content to Windows Media Center. If you look at what HP has done with their new line of HD monitors and televisions they are building Windows Media Center Extender technology directly into the devices so you don't even need a set top box. I think if this ever takes a strong hold on the market you can say good by to the cable providers, they'll end up watching their market share dwindle as more and more providers move to Internet broadcasting.

Second I looked into downloading the various Internet video web casts for viewing. My God are there a bunch of them! I tried several different plug-ins that allowed you to specify the URL to an RSS feed which would then download the videos in the feed contents. Many of these did not work all that great or were too cumbersome to setup. Here is a tip for all these type of plug-in providers, figure out a way to do all of the downloading and updates in the background. And quit stuffing in advertising in front of other people's content unless you are hosting it. A good example of what I'm talking abut is TVTonic, not only do they eat up all of your time updating RSS Feeds when you launch the plug-in they shove their own advertising in between every web cast you pull from someone else's web site. It kind of reminds me of the days of shareware CDs where people would charge to deliver content that they never created.

I found it easier to use a tool like Juice to pull my content down for me. I just enter in the URLs of my favorite web casts and have them download to my video directory and presto everything just shows up in my Video library ready to watch. And when I'm down watching a web cast and no longer need it I can delete it from my hard drive from within Media Center. The great thing about Juice is that it can run in the background and check feeds periodically so you can get new shows within hours after they have been posted. It also works great for audio pod casts.

So I'm going to keep the cable signal turned off and I'm going to continue to explore the world of Internet Broadcasting. The next thing I have to do is find a plug-in that will let me watch streaming Internet broadcasts. There are a lot of services popping up that provide streaming video 24/7 that I'd like to bring into Windows Media Center and watch. Once I get this all worked out I'll give you an update on how it all works out.

I think over the past 30 days I've found out one thing about myself. I originally left cable because I was tired of being bombarded with advertisements every 5 to 10 minutes. They are annoying and I'm tired of being ripped off by corporations that are collecting money from both ends of the system; advertisers and consumers. Originally advertising was a way to pay for the free broadcast of content, but cable and satellite companies have taken that and added on charging large sums of money to consumers for delivery of the content. They have paid for their infrastructure many times over and the fact that broadcasters and cable companies have dissected content in to neat 5 or 10 minute chunks so they can wrap it all up in advertising has turned me off. I found out that I can live with content sponsored by a company if it's done in a tasteful way that does not distract from the overall content of the program. I'll gladly listen to it and may even use their products in order to support the content providers. I've always been one to support those who provide value to me.

I've also seen the crest of a new wave that will soon turn into a Tsunami once the right formula is found. The Internet has flattened the field of broadcasting so much that anyone with a video camera, a PC and the right software can become their own content provider. This is going to change the world we live in so much that I can't even fathom what it will be like in the next 10 years. We are at the door step to information overload not only at work but in our personal lives as well. We need to look into new technologies that will allow us to cut through all of the noise and bring us the content that is important to us in the manner we prefer, whether that be to our TV sets, our computers, our cell phones, or our media players.


Sometimes when defining a property for a domain model element you may need to use a complex type that has more than one property or can't easily be displayed using a single text field or drop down in the property editor. A good example might be a class that holds a list of strings for a GUI interface or a Rich Text editor for a custom text field required by your framework.

To resolve this you can create a custom editor and hook it into your domain model that will provide a proper user interface to specify information for your property.

There are three steps you need to take in order to wire your domain property to display a custom editor:

1. Create a class derived from System.Drawing.Design.UITypeEditor that will launch the custom dialog box as below:

using System;
using System.Collections.Generic;
using System.Text;
 
// Need to add a reference to System.Drawing DLL.
using System.Drawing.Design;
using System.Security.Permissions;
using Microsoft.VisualStudio.Modeling;
using Microsoft.VisualStudio.Modeling.Design;
 
namespace XXX.UIProcessDesigner.UIEditors
{
 
    // FxCop rule: must have same security demands as parent class
    [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust"), PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
    public class FormPromptUITypeEditor : System.Drawing.Design.UITypeEditor
    {
 
        /// <summary>
        /// Overridden to specify that our editor is a modal form
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.Modal;
        }
 
 
        /// <summary>
        /// Called by VS whenever the user clicks on the ellipsis in the 
        /// properties window for a property to which this editor is linked.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(
            System.ComponentModel.ITypeDescriptorContext context,
            IServiceProvider provider,
            object value)
        {
 
            // Get a reference to the underlying property element
            ElementPropertyDescriptor descriptor = context.PropertyDescriptor as ElementPropertyDescriptor;
            ModelElement underlyingModelElent = descriptor.ModelElement;
 
            // context.Instance also returns a model element, but this will either
            // be the shape representing the underlying element (if you selected
            // the element via the design surface), or the underlying element 
            // itself (if you selected the element via the model explorer)
            ModelElement element = context.Instance as ModelElement;
 
            FormPromptUITypeEditorForm theForm = new FormPromptUITypeEditorForm();
 
            theForm.Value = (string)value;
 
            if (theForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                value = theForm.Value;
            }
 
            return value;
        }
 
    }
 
}

2. Create a Windows Form dialog that will be displayed when the editor is invoked, such as the one below:

SampleWindowsForm

3. Set the Custom Attributes for the Domain Property to reference the UITypeEditor class you have created.

The text is as follows: [System.ComponentModel.Editor(typeof(XXX.UIProcessDesigner.UIEditors.FormActionTypeUITypeEditor),typeof(System.Drawing.Design.UITypeEditor))]

The bold faced text is the full namespace of your class that derives from UITypeEditor.

SamplePropertiesForm

I normally store all code that I add to a DSL Designer in various folders such as; CustomCode, UIEditors, Validators, etc. That way it is easy to find when I am trying to reference it.

Also, you can debug the UITypeEditor and Dialog by setting breakpoints in the code before you start debugging.


Wednesday, June 04, 2008 #

I've decided that there is so many new technologies coming out that I am going to spend the next 30 days watching and listening to nothing but technical podcasts and webcasts. I'm turning off the cable signal and hooking the PC to the 42 inch plasma screen in the living room and start making more productive use of my time. Instead of watching mindless reality TV shows filled with commercials every five minutes I'll get up to speed on the latest coming out of Microsoft, Oracle and Sun. And instead of listening to commercial laden radio during my 45 minute commute to work or while tooling around the metroplex, I'll hook up my Zune to an FM Transmitter and catch up on all of the podcasts that I never seem to get around to.

So stay tuned and I'll let you know the gems that I uncover and keep you up to date on the Network TV withdrawal symptoms that might come up.

Technorati Tags: ,,

Tuesday, June 03, 2008 #

I just got back from attending my first Dallas VSTS User Group Meeting. Vince Blasberg gave a presentation titled "Reporting in Visual Studio Team System." He gave a great deep dive into the database architecture around TFS, the Data Warehouse and the OLAP Services. Vince also had some great tips on how custom work item field attributes can affect reporting as well as learning resources around building TFS Reports. I'm hoping we do a deep dive around mining the Data Warehouse for dashboard data reporting. It was great first experience with the group.

Turns out that Vince and I worked together at CLR/FAST-TAX back in the mid 90s. We spent some time after the meeting chatting about old friends and the old days of working 18 hours days getting ready for tax season.

You can learn more about the Dallas VSTS User Group at http://www.dallasvsts.com


So this weekend I was catching up on some web casts and caught Mark Pesce's Keynote from ReMix08 Australia. It was basically about how the current Internet culture is hyper-connected because of social networking sites like Twitter. So, I decided to check it out and joined up. It's pretty simple, just send random posts through out the day to indicate what you are doing or what is on your mind. Besides posting your thoughts and what you are doing, you can follow others and monitor what they are posting. There are even some innovative sights that are monitoring the thousands of posts and using them to come up with some really unique presentations of what the Twitter society is currently thinking.

You can find me at http://www.twitter.com/jimlavin,  maybe we'll bump into each other, who knows.