How do you intend to version across different versions of the same DSL?

Here's the situation I'm in. I am an "application framework" developer. For our product we produce an SDK that customers can use to customize our application. I've been playing with DSLs for a couple of weeks and am VERY happy except...

We produce an SDK for each major version that we ship. We are finishing version 8 and starting to work on version 9. DSLs are a Visual Studio "language" and use the file extension to determine which DSL a file is hooked up to. Changes to our base classes and templates as well as adding more functionality into existing DSLs seems like it would cause a versioning problem.

For example, lets say I produce a wonderful DSL that uses the .myDsl extension for verion 8 of our SDK. We start working on version 9 and we actually get time to put in the neat functionality we didn't have time to do in version 8. We now have two DSLs that both use the same extesion (for example .myDsl) but can't be installed on the same machine at the same time. We can migrate the version 8 to 9 easily enough but we can't have both on the same machine.

This isn't too bad for a customer that would only have version at a time, but for our internal application developers, consultants and VARs/OEMs this would be a huge headache.

The VS packages I created in the past worked fine with this since all the wizards/template were under a version specific package. If they wanted to create a new 8.0 widget they would go to the 8.0 templates and select widget. Now, I will either have to name my extentions "correctly" so myDsl80 and myDsl90. This isn't fatal, but you have to admit it is pretty ugly.

Thanks!

[1707 byte] By [JLeBert] at [2008-1-7]
# 1

Hi,

I am not sure if I would go for the 'changing the extension' of the DSL option to solve version problems. Can't you use source control for this? A developer can get the 8.0 source tree on his dev machine, compile it and, for example, debug the 8.0 version. When he is done with that he can simple get the 9.0 tree and continue working on that version. Isn't that possible in your scenario?

It is even possible to solve the versioning for model files created in your DSL by modifying the serialization behaviour of your DSL.

Edward

EdwardBakker at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 2
I don't think you understood the question. I'm not worried about the 8.0 vs 9.0 source code on the developer's machine. That's a no brainer. I'm also not worrying about the migration. It should be trivial to morph the XML from one version into the next.

Here's an example of the problem. We have a consultant that is working on customizations for 3 or 4 different customers. Each customer might be on a different version of our software. So in your example the consultant would have both the 8.0 and 9.0 versions of the product on his PC. To work on the 8.0 version he would have to uninstall the 9.0 SDK and install the 8.0 SDK. Now he can work on the 8.0 product. This is necessary because the extension is the same for both the 8.0 and 9.0 SDK. Putting version numbers in the extension would solve, but is ugly.

We have this for out application developers also. I might have to work on the 3 year old 8.0 version, the 2 year old 8.1 version and the not yet released 8.2 version. Sometimes we have to put a bug fix in all of these version.

If little changed, this wouldn't be too bad a problem since you could probably just use the 9.0 SDK on the 8.0 product. Unfortunately base classes change, method names change, even little things like code comments in the text template might be enough to force differences in the DSL versions.

The 8.0 version of the SDK might have a method like GetList() and the 9.0 version might be GetList(int maxRows). I could do something like make the 9.0 version support the 8.0 version, but this would get ugly really fast.

Thanks for your response. I love what I can do with DSLs and am pushing to use them as hard as I can!

JLeBert at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 3

So let me make sure I've clearly understood before attempting to give any guidance.

We're talking about the end users of your DSL having multiple versions of the DSL installed at the same time and being able to successfully edit 1.0, 1.1 and 2.0 versions of .Foo files?

GarethJ-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 4

Oh, one further question, could you please expand a little on what mechanisms and techniques you're using when you said

" wizards/template were under a version specific package."

GarethJ-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 5
Here's more detail than you can possibly want...

My company produces a product that has an associated SDK. We have a bunch of Visual Studio wizards and base classes that make up the SDK. For example, we have a wizard + base class that is used to update the database. The wizard picks up things line the web service method name to use, the typed DataSet to use, etc. The base class does the work of updating the database and allowing code to be added to do validation, etc. We have something like 30 of these that deal with the client side, server side, data layer, etc.

Each version of the SDK contains a single Visual Studio package and its associated templates which are used by the wizards. There are both project and project item templates using the standard Visual Studio mechanisms. SInce templates/wizards can change between versions of the SDK we have to version them. When you try to create a new project or project item you will see Product 8.4, Product 8.5 in the list. Selecting one would show you the available template/wizards for that version. For example, if you try to create a new project you will see "Visual C#" in the Project Types tree. If you have our SDK installed you also see Product 8.4 and Product 8.5.

An example user of this is an internal consultant that does work for 5 different customers. Each customer might be on a different version of the software and therefore the consulant needs to have each of the different versions of the SDK installed. All he has to do is make sure he uses the same version of the templates/wizards as the customer is using.

I don't know how to do this with DSL's. For example our 8.4 version of the .foo DSL works great but only had about half the functionality we wanted because of time constraints. Our 8.5 version of the .foo DSL is the best .foo ever. Because of breaking changes we had to make to the base clases, etc. our 8.5 version couldn't be a simple superset of the 8.4 version. This means that they are incompatible with each other. Our consultants (more so) and customers (less so) need to be able to have both installed at the same time. (There are lots of ways around this like multiple computers with a single version installed at the same time, using Virtual PC to do the same or just uninstalling and installing the different versions all the time.)

Since DSL's rely on the file extension, how can I have .foo version 8.4 and .foo version 8.5 on the same computer at the same time? The only solution I could come up with was to put the version number in the extension. So it would be .foo84 and .foo85. This is ugly but at least works. If nobody can come up with a better solution then that is what I will be stuck with.

Another example of this issue is when two separate companies release a DSL with the same extension. If I add this to the issues above that means I have to name the extension .companyFoo84 and .companyFoo85.

So in the above I tried to justify there is a case where a developer would need multiple versions of the "same" DSL installed at the same time. Migration of the 8.4 DSL to the 8.5 DSL isn't acceptable because we need to use the 8.4 version since the 8.5 is not compatible.

Sorry for the long post. I really hope this made sense because this is a big issue for our product.

JLeBert at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 6

You can create several DSLs with the same file extension. You can use "open with" to select which one is opened, and to set the default editor for the file extension.

You can also change the version (major, minor, build, revision) in the Language node in the DSL explorer, which will save the DSL version in each file, and then trying to open a wrong version will output a "version mismatch" message.

Will this work for you?

-- Steve

SteveCookMSFT at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 7

Not the perfect answer, but more than good enough!

I looked through the registry and it looks pretty simple to find the Editors that have the extension and set it correctly. This means that I can set the default when I'm installing the newer version DSLs. I can also have a button on my Tools\Options page to set the defaults for all my DSLs of the same version.

Thanks for the help!

JLeBert at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...

Visual Studio

Site Classified