Designing .NET Class Libraries: Enabling Development Tools (April 13, 2005)

Posted: June 28, 2005

Please note: Portions of this transcript have been edited for clarity

Introduction

frankred [MS] (Moderator):
Hello & welcome to today’s Designing .NET Class Libraries chat on Enabling Development Tools.
Now, let’s introduce our knowledgeable experts...

BrianPe [MS] (Expert):
Hello. I'm Brian Pepin and I'm a developer on the Windows Forms team.

Joe Duffy [MS] (Expert):
Welcome to the chat! My name's Joe Duffy, and I work as a PM on the CLR team. Looking forward to some good questions...

frankred [MS] (Moderator):
Let the chatting begin! :)

Start of Chat

BrianPe [MS] (Expert):
Q: Can we and how do we make VS 2005 build 1.1 code?
A: At this time VS 2005 can only build 2005 apps written for CLR 2.0.

BradA [MS] (Expert):
Q: do you konw longhorn
A: Sure - -what's the question?

BrianPe [MS] (Expert):
Q: can you outline the scope of this chat - thanks
A: This chat covers how to provide enhanced Visual Studio support for your own classes and controls.

BradA [MS] (Expert):
This chat is about Building the Design Time for your controls..

BradA [MS] (Expert):
Q: Is it out yet
A: Nope -- we are still hard at work -- later this year...

BradA [MS] (Expert):
Q: On object creation, what would you recommend as a method for populating for an object that has 10 child classes/collections that needed to be loaded when the parent class is called? would you create one massive dataset with datatables?best practice sugg?
A: Here is the abstract from the session we are discussing:

BradA [MS] (Expert):
Learn how to enable a rich development experience for your users by writing code that exploits the capabilities of Visual Studio. Covers extending and augmenting the development, debugging, and design environments.

BradA [MS] (Expert):
Have you tried to create a design time for your own controls? How hard\easy was it?

BrianPe [MS] (Expert):
Q: What are the biggest challenges you find when designing for a developer community?
A: To me, the biggest challenge is where to target on the complexity spectrum. At one end of the spectrum is easy of use, and at the other is feature richness. Of course, we always want both. Finding the right mix there is always a challenge.

Joe Duffy [MS] (Expert):
Q: On object creation, what would you recommend as a method for populating for an object that has 10 child classes/collections that needed to be loaded when the parent class is called? would you create one massive dataset with datatables?best practice sugg?
A: It depends on your scenario. If you're loading values from a database, it might make sense just to use a DataSet and hand that out to clients. I'm assuming you are dealing with a db since you explicitly mentioned DataSets. :) You can take the next step, and add properties that really just grab values from the DataSet--so it looks to users of your class like you just store them in fields. Or, you could go the next step, and populate a set of fields with the values as you load them from the DB. You then have to choose whether this all happens lazily or eagerly. For example, do you load all of this in your constructor, or the first time a value is accessed? If you're doing some sort of associative lookup that spans tables, for example a List property, then it might make sense to do this lazily (especially if many of your usage scenarios don't need the list at all).

BradA [MS] (Expert):
Q: Is longhorn a OS that you have to wirte program to be able to use the window
A: I am not sure I understand the question, the programming model for LH is much like that of Windows XP... does that help?

BradA [MS] (Expert):
Q: so we can just use it without writing the programs
A: Yup... just like Windows XP...

BrianPe [MS] (Expert):
Q: we had problems with visual inheritance in vs2003, with the designer 'shrinking our controls' - has 2005 got an improved VI model?
A: We've tried to do a lot better with Visual Inheritance in 2005, but I can't say we've gotten things perfect. There are some scenarios for Visual Inheritance where we simply don't have enough data in the designer to make the right choices. For VS 2005, we've tried to prevent you from getting into situations where we can't make the right decisions. For your specific case, shrinking controls was commonly caused by your base form being designed at one screen resolution while your derived form was designed at another. We did fix a lot of issues here, including implementing an entirely new form scaling algorithm.

BrianPe [MS] (Expert):
Q: this chat is for IDE enhanced visual studio 2005 developers ?
A: Yes, but we will also cover VS 2003 and 2002 (if we can remember)

BradA [MS] (Expert):
Good question Ohad.. I think it comes down to what kind of app you want today... if you want a smart client app then using Winforms is the best way to do that today...

BrianPe [MS] (Expert):
Q: can we reference a 2.0 assembly from a 1.1 assembly, and if so, can we do it in VS2003?
A: You can't do this, but you can do it the other way around. The problem is if your 2.0 assembly relies on 2.0 features it would not work under a 1.1 CLR. You can force the issue by writing binding redirects in your application's config file, but your app would fail as soon as the 2.0 assembly tried to make use of 2.0 features.

BrianPe [MS] (Expert):
Q: Will the 2005 IDE support edit and continue functionality?
A: Yes, E&C is online in Beta 2 builds of VS 2005, but only for some languages. Which languages are you interested in?

BradA [MS] (Expert):
Andy -- nope, sorry... try https://support.microsoft.com

BradA [MS] (Expert):
You know "Longhorn", let's take this off line... i want this chat to be about adding design time to your contorls...

BradA [MS] (Expert):
Did you folks have a chance to watch the video... any thoughts from that? https://msdn2.microsoft.com/netframework/aa497254.aspx

BradA [MS] (Expert):
Q: will there be a possibilty to have a central repository for code snippets so that all developers in a team can benefit from custom code snippets?
A: Yes! VS2005 has a feature like this... I don't have the details on my, but if you follow up with me after the chat I will get them for you (brada@microsoft.com)

BrianPe [MS] (Expert):
Q: Edit and continue in C#
A: The options are definitely there in the IDE for C#, but after fiddling with it for a minute or two I can't seem to make it work in the random build I've got.

BradA [MS] (Expert):
Q: From what I understoond E&C was implemented in CLR level so any language could make use of it no?
A: That is right... the core E&C work is done via IL diffs at when the CLR is run in the right mode... Now there is TONS of work for compilers and IDEs to create the those IL diffs... but anyone willing to do the work can add E&C to their languages... Joe, any plans to add E&C to Snencha

BrianPe [MS] (Expert):
Q: Is there any new support for creating custom IDE. Ofcourse not another VStudio but a custom tool that can let users design a form by dragging and dropping conrols, set properties and then the tool would generate code to reflect the UI design.
A: Yes, there is. Here is a very simple HelloWorld sample that creates a form designer. There is no persistence; you've got to write that yourself:

BradA [MS] (Expert):
Q: VS 2003 seems to have a fair share of bugs. Why does MS expect us to purchase VS 2005 instead of offering fixes? VS 6 had *six* service packs.
A: Thanks for raising that Alex... We are of course going to continue to support VS 2003 with SPs, etc for several years. But the kinds of big changes we made in VS2005 required a new version of the tool.

BrianPe [MS] (Expert):
Here is a sample for creating a very simple designer:
DesignSurface ds = new DesignSurface(typeof(Form));
Control c = (Control)ds.View;
c.Dock = DockStyle.Fill;
Controls.Add(c);

BradA [MS] (Expert):
Q: Gets Visual Source Safe in VS2005 new features?
A: There are some new features in VSS in 2005... drop me an email and I will contect you with the right folks to enumerate those...

BrianPe [MS] (Expert):
Q: can you outline the design time support changes in 2005 over 2003? - i assume you can use drag lines and smart tags?
A: There are a lot of changes included in 2005 for design time. Here are just a few: smart tags, snap lines, modular persistence, and designer hosting. As a control vendor you have a lot of control over all of these, and the hosting part is useful because it gives your control reach outside of Visual Studio.

Joe Duffy [MS] (Expert):
Brad: No plans right now for E&C in Sencha (my toy scheme->clr compiler). Gotta focus on getting VSIP working right, syntax highlighting and everything else. This is sort of the natural progression that most people go through. Not many "toy languages" spend a lot of time on VS integration unfortunately, mostly due to time constraints. Good question for Don though (F#: https://blogs.msdn.com/dsyme/)! E&C in F# would be great. :)

BrianPe [MS] (Expert):
Q: Will we be able to maintain components written in Framework 1.1 in the 2.0 environment [maintenence coding], or do they get implicitly upgraded?
A: They get implictly upgraded. The best way of doing maintenance today is to keep a VS 2003 environment available.

BrianPe [MS] (Expert):
Q: I'd like to create a List but assuming the type declaration gets more complicated than this I want my client code to not have to declare it with it's "ugly" face. Is there a more widespread solution than to "alias" it in each file? Inheritance?
A: Yes, you can use inheritance: MyCoolList : List {}

Joe Duffy [MS] (Expert):
Q: I'd like to create a List but assuming the type declaration gets more complicated than this I want my client code to not have to declare it with it's "ugly" face. Is there a more widespread solution than to "alias" it in each file? Inheritance?
A: So what you're saying is that you don't want users of your class to type List all over the place... You'd rather see something like FooList instead. Inheritence is a fine way to solve this problem. Just write your class definition as: public class FooList : System.Collections.Generic.List { }

BrianPe [MS] (Expert):
Q: Is anything changing in whidbey on debugging windows forms custom designers?
A: Nothing specific, although I believe we're trying to document how to do it a bit better. What kinds of things are you looking for?

frankred [MS] (Moderator):
Q: It seems like the chat room is experiencing some problems... The upper pane was repeating all over again.. Then I refreshed the browser and when it came back, there was no upper pane anymore
A: We're investigating the problem.

frankred [MS] (Moderator):
Q: It is imposible to read the answerd while it cycle so much
A: We're investigating the problem.

frankred [MS] (Moderator):
Q: Now am not even seeing the upper pane updates :(
A: We're investigating the problem.

frankred [MS] (Moderator):
Q: the upper pan is rolling agian
A: We're investigating the problem.

frankred [MS] (Moderator):
Q: frankred: Where is the upper pane?
A: We're investigating the problem.

frankred [MS] (Moderator):
Q: Sorry if anybody allready replied to my complaints, but I wasn't able to see response (if any)
A: We're investigating the problem.

BrianPe [MS] (Expert):
Q: BrianPe: inheritance doesn't solve it for me. FOr example assume a method such as "List Merge(List

Top of pageTop of page