June 2007 - Posts

Visual Studio SDK: Improve my productivity by removing some docs

Talking about obscure...

Take a quick look at the documentation for IVsTextManager.RegisterView method.

The main description for the method reads: "Method information is not provided."

Ok... there isn't much I can guess about the method from that so let's see what the arguments this method takes are about in order to help the guessing game. Its signature is:

int RegisterView (
	[InAttribute] IVsTextView pView,
	[InAttribute] IVsTextBuffer pBuffer
)

What are pView and pBuffer about? Let's check that doco again:

Parameters

pView

Do not use.

pBuffer

Do not use.

Does "do not use" really means "I've no idea what should go here"? Or is it more like "this is used internally by VS and maybe we should have said that at the method description where we originally said 'method information is not provided'"?

At this point you may be lead to believe whoever put this page online just doesn't care about your time. I mean, you took the time to search for this method, you were directed to MSDN, you open and read the help and you get zero information at all. I don't think this is the case. I'm guessing there is some automated tool that produces a million pages based on XML comments or something similar and that's the reason why some non-sense pages like this one end up online.

Based on this I can think of a way to automatically improve VSX developer's productivity out there: JUST remove pages like this one. You can save me a minute or two by doing so.

Posted by vga with no comments
Filed under: ,

GAX/GAT for Orcas: coming soon!

If you're into extending Visual Studio then there are good news for you.

Grigori Melnik, Product Manager for GAX/GAT from Microsoft p&p, has announced there will be a compatible version that runs on Orcas pretty soon.

Posted by vga with no comments

“The Shell” (not a Hollywood production)

 

The announcement at TechEd 07 seems to have been received well by the blogsphere. For example Pablo is sayingWOW... finally extending Visual Studio will be much easier…”.

 

I’ve to admit, I don’t find this near that exciting, sorry.

 

We have had Visual Studio PPE edition before. And we already had an idea of what can be done with the “shell”; basically if you’ve installed Team Explorer in a box without Visual Studio on it you’ve already experience “the shell”.

 

So, Victor, what’s really new here? Thanks for asking!

 

In my opinion the most important thing to notice is that they have now removed the “expensive” part; it is nothing but great news to find out that you will be able to distribute royalty-free the “shell’ with your custom extension.

 

But the “obscure” it still there. There is nothing new regarding helping you writing these extensions in order for you to have something at all that you could ship royalty free at the end of the day.

 

So, how many people will actually take immediate advantage of this? Those who are *already* experienced enough to write their own extensions and couldn’t afford a non-royalty free license before. Take a pen and a very small piece of paper and that should be enough to write down all their names.

 

Overall, I’m happy as this is still a good move, but there is much more work to be done (which can be read too as: I’m not happy as I could be…)

 

I would really kill to see news in the direction of putting some light into the “obscure”.

 
Posted by vga with no comments
Filed under: ,

Dreaming of a huge Visual Studio Community

 

What is the hardcore way of extending Visual Studio: VSIP.

And what are the first things that come to mind when you think of “VSIP”: expensive and obscure. Expensive because it used to be 10k/year and obscure because its COM roots and it’s very poor (close to inexistent) documentation.

You tell me how do you build a huge community around expensive and obscure? You just simple can’t. I believe the past years were more than enough to prove this.

So, someone at Microsoft realized about this fact and VSX was created. A new name is always a good thing; better yet if it is a TLA and begins or ends with ‘X’, you can hardly beat that :-)

What VSX is about (besides the cool name)? The official word won’t tell much but this is what I’m noticing: new useful samples in the VSSDK using managed code and improved documentation (or at least, part of it). The samples source code is still a good place where to find code comments that will give you much more information than what the docs will tell you.

Can you build a community around VSX? Although this is surely an improvement over expensive and obscure, IMO, this is still not enough.

Why?

Because all of the “obscure” it’s still there. Because you still need to mess with COM interfaces all the time and the versioning craziness like “IVsComponentEnumeratorFactory3” and native structures and enumerations that were coded when naming like “__VSMEPROPID2. VSMEPROPID_LAST2” made any sense. Let alone the VBisms you can find in today’s DTE automation layer (like indexes starting at 1 instead of 0, etc). Also, I don’t want 45 different and incompatible ways of doing the same thing.

It is 2007 now. I want a nice and clean OO framework that I could proudly look at without my eyes being hurt and that I can confidently build upon it.

Enough criticism now and let’s add some constructiveness to this post.

What needs to be done?

1)    Ideally: give me a new and fully managed IDE. Get your internal teams to rewrite their packages against this new IDE. Get your partners up to speed too. Even if you need to name this thing “Visual Studio 2011” I’m still fine with it.

Or

2)    Give me a Visual Studio Framework (think of MPF on steroids). This framework should totally abstract me from the fact of knowing what’s going on at the metal level. Not a single trace of COM or VB automation, just clean and simple OO code I could code against.

I can’t really see a huge Visual Studio community taking off and growing exponentially without either 1) or 2) in place.

 

Posted by vga with 7 comment(s)
Filed under: ,

My Love / Hate relationship with Visual Studio

 

Back in 2001 I used to know the ASP.NET bits from top to bottom getting to its internal (thanks Reflector!) to a very down-to-the-metal level. I could recite the page lifecycle from top of my head, tell you what you may being doing wrong regarding it without actually looking at your code (my 4000+ posts answering questions at the newsgroups are a living testimony of this) and I also contributed to the ASP.Net team with lots and lots of bug reports, besides writing a couple of articles for different ASP.NET topics in MSDN and having co-authored two books too. We can say I was breathing ASP.Net at that time and for the next couple following years.

 

Now, in 2007, as some of you may already know I’ve been working -silently I should say, as my blogging activity pretty much sucked- almost exclusively extending Visual Studio for the last 3+ years.

 

What follow are a few paragraphs of how I feel about this (yes, this is the point where you can stop reading!).

 

Visual Studio is a tool I love to use.

 

It’s has been enhanced over the years with new features you could really feel.

 

As a small sample of this there is IntelliSense all over the place: code editor, watch window, immediate window, and the terrific work done by the ASP.Net team on editing HTML pages that can be mixed with C# or VB while retaining the same experience as if you were editing a plain C# or VB code file.

 

Visual Studio is a tool I hate to extend.

 

Due to its original architecture and its need to support lots of legacy code there isn’t yet a clean and nice managed approach to extend it. Lately (and thanks heaven!) there have been lots of moves that seem oriented to make this change a reality: VSX, Shell, etc. I’ll talk about these in separate posts.

 

That said, I’m still very happy and enjoying my daily work. Why? Because I love challenges.

 

And let me tell you -in case you still didn’t know- extending Visual Studio is a hell of a new challenge each day!!

 

 
Posted by vga with 2 comment(s)
Filed under: ,

Adopting Software Factories Today == Clarius SFT

We just released the June 2007 CTP of our Clarius SFT including some new cool features to help in shortening the existing gap between current Software Factories-related technologies, like GAX/GAT and DSL Tools.

 

This toolkit will help you in getting things done today.

 

It contains features that will abstract you enough from the boring details of how to make the plumbing required for integrating the existing technologies, letting you concentrate on the specific domain of your Software Factory.

 

There is a runtime part extending GAX/GAT and DSL runtimes covering common scenarios for which there is no built-in support: as scripting, eventing, etc.

 

And, a design-time part, offering tools as a Recipe Designer, Recipe Binder, T4 Editor and lots of wizards.

 

With more than 8000+ downloads already and counting it’s becoming a must have tool for every developer working on developing factories today.

 

So, if you’re into Software Factories development and you haven’t tried SFT yet, you’re missing a key part of the picture!

 
Posted by vga with no comments
Filed under: , , ,

Adding Commands to a DSL from a 10,000ft view

 

The DSL Tools are a huge improvement towards getting a VS designer up and running in no time.

They make a good job of keeping you abstracted at a 10,000ft view from the inner workings of a Visual Studio designer.  You drag and drop shapes all around, defining your domain model and its graphical representation. You set properties here and there. And… you’re ready to go!

You now have thousands and thousands of automatically generated code implementing a VS designer which would have took you weeks to write if you went from scratch. That’s nice.

Now, let’s say you’re the kind of developer that likes to push the envelope and you come with the very wild idea of adding a menu command to the designer surface or a given shape of your DSL. Oh, yes, you’re wild.

At this point if you were an airplane you would have crashed. The nice 10,000ft altitude and the “I don’t have to worry about the dirty details” that you were used to while designing your domain model have changed for the feeling of hitting hard the ground.

You need to follow a several steps procedure which includes things as dealing with a C++ preprocessor and knowing in lots of detail one of the most arcane format that Microsoft may have invented, the obscure world of Command Table definitions.

So, you’re already thinking of hiring a skilled senior C++ developer so you can add your menu command? Well, that’s not required if you’re willing to put the time to learn lots of non-interesting stuff about how to define a command, but if you have the time, you will eventually make it work (and that’s because you’re a wild developer, remember that).

With SFT we try to keep you at the 10,000ft for adding commands too. And in our latest public drop we’ve included an enhanced DSL Recipe Binder Wizard that will do the magic for you.

It allows you to choose between binding a command to a built-in shape (the designer surface, a link, etc) or one of your custom shapes (your foo shape), and specifying on which kind of selection you want your command to appear: single, multiple or any? Moreover, you want your command to appear only for those Foo shapes whose Bar whose property start with a ‘C’? Easy enough, click a checkbox specifying you want to customize the selection logic and you will get a partial class with an override method taking a Foo shape where you can write the single line of code required to check the Bar property.

 

This is how it looks like:

 

Trust me, this is as easy as it gets.
Posted by vga with no comments

Deploying Guidance Packages and DSLs the easy way

Let’s do a 15 seconds recap on what currently GAX/GAT and DSL Tools offer regarding deployment.

GAT: uses Visual Studio Setup projects (can you feel the pain already?) to deploy your custom guidance packages. If you don’t need anything beyond the very simply basics this setup will work nice even if you modify your guidance package sources after you created the setup, something that sounds basic enough but it’s not true for DSL Setup projects. Now, do you want to customize any part of the Guidance Package setup process with some detail? Good luck!

DSL Tools: uses WiX-based setups (hurray!) but… they’re as “static” as something can get. If you play with your DSL Tools and you afterwards create the Setup project high chances are that you end up with a non-working setup that needs manual editing, that’s not nice at all (after all: can’t you just read my DSL project at Setup creation time and play clever outputting something that works?). Even if you manage to create a working Setup (meaning basically you didn’t touch a thing from the original created DSL Package project) it will break as soon as you need any customization. Yes, you can try to learn the setup domain model that is there and update it manually every time you make a change, but... who really wants to do this?

Sounds bad enough already? Let’s complicate things a bit more. Let’s say your solution includes more than one guidance package and more than one DSL Tools, the successfully Web Services Software Factory from p&p, in its latest incarnation v3 (under development), is an example of this, last time I checked it included a couple of guidance packages and a couple DSL designers. You want to deploy this beast? Be my guest, you will only need to ask your users to install 4 or 5 different MSIs...

We notice this and took action in SFT by introducing a new SFT Setup project feature which lets you choose from all the guidance packages and DSLs found in your solution and get a single WiX-based project that generates a single MSI that will install as many guidance packages and DSLs as you wish; this is how it looks like:

 

All you need to do is a few mouse clicks, no manual editing required, auto-updating of the setup project, and no custom domain model to learn about.

Can this get even better? Let me know how: vga -AT- clariusconsulting -DOT- net.

Want to learn more about this feature? Check Adrian’s blog who developed it.

Posted by vga with no comments

Editing Text Template (T4) files: the Visual Studio/Notepad vs. SFT experience

If you have ever worked with GAX/GAT and/or the DSL Tools chances are that you had to look at existing templates and maybe customize them or create your own. Currently none of these two technologies offers you any remedies for the pain that is browsing and editing these templates with a “plain-text” experience.

So, let’s say you want to understand the serialization code in order to being able to introduce a few customizations of your own here and there. Try editing C:\Program Files\Visual Studio 2005 SDK\2006.09\VisualStudioIntegration\Tools\DSLTools\TextTemplates\Dsl\DomainClassSerializer.tt with Visual Studio (or notepad for that matter, as you’re not going to tell the difference in this case), it’s “only” 3751 lines of NO syntax coloring, NO code completion, NO quick navigation, NO nothing.

Let’s take another large file, Diagram.tt (living in the same folder as the file pointed out above). What changes in this case? It’s “only” 2469 lines in length, much shorter than the previous file, and we still get the NO nothing.

Ok, these are large files, not every text template file will be that large, granted. But can you still live with the “NO nothing” experience even for smaller files? I don’t think so, I know I can’t.

This is the reason why we have introduced a Text Template editor into SFT, for helping you today with your daily tasks in developing Software Factory projects.

Here is a single screenshot that should tease you enough to go download the bits:

 

 
You can also take a look at the T4 Editor’s Quick Users Guide (lots of screenshots in there) and if you want to learn more about this feature you can check Jose’s blog who works on the SFT team.

 

Posted by vga with no comments
More Posts