Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-17 Thread Stefan Holdermans
Hi all, JF I would argue that the behavior described by the original JF poster is in fact a bug. The spec says (part. I 8.5.3.1 JF Visibility Of Type): The visibility of a type definer is the JF same as that for the type from which it was generated. (as I JF understand it, an array type

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-15 Thread Stefan Holdermans
Allaoua, DS It seems that via Reflection I get that the array type DS SomeClass[] has public visibility. I would expect it to have DS the same visibility as its element type. Any ideas how this DS can happen? AC SomeClass is private by default. It does not inherit the AC scope of the

Re: [ADVANCED-DOTNET] Enumeration bounds checking?

2004-04-11 Thread Stefan Holdermans
Michael, MS This is curious, and not covered in the C# language spec MS that I can find. There appears not to be bounds checking MS invoked when enums are passed as parameters. DC If it's important in your application you can perform DC checking yourself pretty easily without bogging

Re: [ADVANCED-DOTNET] Enumeration bounds checking?

2004-04-11 Thread Stefan Holdermans
John, JE This fails at compile-time: JE JE public enum MyEnum : short { JE ValueOne = 0, JE ValueTwo = 1, JE } JE JE Console.WriteLine((MyEnum)Int32.MaxValue); What is exactly your point, here? C#'s short type is mapped to System.Int16. Surely 2^32 - 1 exeeds the

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-02 Thread Stefan Holdermans
Hi, Adam wrote: AS Its still got bad idea stamped all over it. The object would AS not get constructed, this is almost certainly doc'd somewhere. Mmm ... I'm not sure if I'd label that a disadvantage. When, I ask for the construction of an object and something goes wrong, I find it

Re: [ADVANCED-DOTNET] Configuration File....

2004-03-05 Thread Stefan Holdermans
Sarvajith, SC But since i cannot debug the start method, i made a windows SC app, which has an object of the service class and calls SC another method, identical to the start method. Assuming that your service app is service.exe and your test app is test.exe, you've probably called the config

Re: [ADVANCED-DOTNET] Transparent Persistence

2004-02-15 Thread Stefan Holdermans
Frans, [...] After all, the m:n link table IS an entity, by definition of the relational model. [...] Not just an entity, however. ER modelling would recognize it as a *weak* entity. The linking table in the relational database typically will not be biased towards either of the two linked

Re: [ADVANCED-DOTNET] Transparent Persistence

2004-02-14 Thread Stefan Holdermans
Thanks Jeff, Come on, Frans. You know, at your level of experience, that the physical model of a database is often very different from the logical one. He's saying that it's sometimes the case that someone builds a database first and the application after, and that the data structures

Re: [ADVANCED-DOTNET] Transparent Persistence

2004-02-14 Thread Stefan Holdermans
Frans, What's auto-persistence and in that light 'not auto-persisted' ? If these uber-vague terms without any real meaning aren't defined, this discussion ends up being a very academic babbling between people who don't understand the true meaning of what persistence really is. In

Re: [ADVANCED-DOTNET] Transparent Persistence [WAS: Web Services, Remoting and Coupling]

2004-02-13 Thread Stefan Holdermans
Hi, Great dicussion so far! So let's move beyond O/R mapping and data layer encapsulation. The topic of transparent persistence has come up a few times. I was wondering which techniques you guys employ in order to achieve transparency. I'm thinking in terms of an application layer and a data

Re: [ADVANCED-DOTNET] Transparent Persistence [WAS: Web Services, Remoting and Coupling]

2004-02-13 Thread Stefan Holdermans
Frans, First of all, let me say that 'transparent persistence' is a good candidate for buzzword bingo. What exactly is transparent persistence? Is it the total absence of any persistence logic whatsoever? Or is it the absence of a separate broker/adapter object so all persistence

Re: [ADVANCED-DOTNET] Transparent Persistence

2004-02-13 Thread Stefan Holdermans
Jeff, So what do you think of this approach? I wouldn't mind using an object-relational autopersistence scheme for the main object if it met my needs; I just haven't gotten around to learning how to use one yet. If you did do the edit logic how I describe, though, I think that it would be

Re: [ADVANCED-DOTNET] Transparent Persistence

2004-02-13 Thread Stefan Holdermans
Frans, Whoa, who's the one who doesn't understand what system design is all about? :-S Ouch. That hurts. It really does. But---fortunately---you misunderstood me. ;) Modeling is hard. But let's assume that we've managed to do a good job here and that we came up with a very good model

Re: [ADVANCED-DOTNET] Microsoft's future plans for Component Services and ORM

2004-02-11 Thread Stefan Holdermans
James, I think there's a little confusion here. The 'ORM' you refer to stands for 'Object Role Modelling'. The discussion however focusses on 'Object-Relational Mapping'. Just a matter of 'buzzword bingo', I guess. :) Regards, Stefan -Original Message- From: [EMAIL PROTECTED]

Re: [ADVANCED-DOTNET] Best way to share an interface definition amoung components tier

2004-01-20 Thread Stefan Holdermans
Ross, My understanding is that the type is defined with reference to the namespace from which it is exposed and the namespace does not neccessarily correspond to the assembly name ie namespaces can span assemblies so one could conceivably define the same type in two different assemblies.

Re: [ADVANCED-DOTNET] How to create an enumeration that exposes formats

2003-10-24 Thread Stefan Holdermans
Jeff, One thing I've found is that the IDE doesn't like it when you use HTML tags like br that don't have a closing tag. [...] Well, it's not only the IDE that doesn't like that. The C# compiler expects the documentation comments to be in XML. When you use HTML constructs like unclosed f.i.

Re: [ADVANCED-DOTNET] Do properties need a 'holder' keyword?

2003-10-23 Thread Stefan Holdermans
Frans, Showing how to implement different access levels for the getter and setter of a property, you suggested: Afaik, you can. Define the property get on another interface than the set. Then implement the interface directly: protected int IFoo.Count {{ get return _count;}}

Re: [ADVANCED-DOTNET] Do properties need a 'holder' keyword?

2003-10-22 Thread Stefan Holdermans
Jeff, [...] Also, what's the relative cost of a property get/set versus a method invocation? There is no such cost, i.e. the notion of properties only exists on the metadata level --- runtime there is no difference between method invocation and calling a property's getter or setter. P.S. I

Re: [ADVANCED-DOTNET] COM+ Caching

2003-09-08 Thread Stefan Holdermans
Stephen, I work at a large telco, and we have a good relationship with our Microsoft account manager. They did us a favor by having one of their consultants come in to have a look at our work in progress. We are migrating our presentation and business layers to .NET - the fellow that came

Re: [ADVANCED-DOTNET] Nasty bug in 1.0 and 1.1 compiler

2003-08-28 Thread Stefan Holdermans
J. Merrill wrote: In this code, do you need both the TRY and FINALLY blocks to be empty to see the bug? That's also not a likely real-world construct, is it? Well, try to imagine a design in which a class that implements IDisposable carries out some useful work *in its constructor*:

Re: [ADVANCED-DOTNET] Recursive Reflection for value types question

2003-07-22 Thread Stefan Holdermans
Michel, Have you consider to retrieve a copy of the inner object using GetValue, alter it, and then overwriting the inner object with the modified copy using SetValue? HTH, Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michel Liesmons Sent:

Re: [ADVANCED-DOTNET] Add Declarative Reference To Assembly

2003-07-15 Thread Stefan Holdermans
refernce to using the feature in the VB.NET version. Or is it truly a compiler problem in that it simply does not remove unused references? Doug -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Holdermans Sent: Monday

Re: [ADVANCED-DOTNET] Add Declarative Reference To Assembly

2003-07-14 Thread Stefan Holdermans
constrained to use) does not share the ability to remove unused assembly references. Is there any way (or possibly an add-in) that would allow VB to behave the same way? Thanks! Matthew -Original Message- From: Stefan Holdermans [mailto:[EMAIL PROTECTED] Sent: Saturday, July 12, 2003 4

Re: [ADVANCED-DOTNET] Add Declaritive Reference To Assembly

2003-07-13 Thread Stefan Holdermans
Matthew, When the code in your Release configuration does not use any of the types from a particular assembly A, then the resulting assembly will not include any references to A. For instance: I've a library project that makes uses of the types in the assembly nunit.framework *only* in Debug

Re: [ADVANCED-DOTNET] Partially constructed objects in C#

2003-06-20 Thread Stefan Holdermans
); } } -Original Message- From: Stefan Holdermans [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 3:11 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Partially constructed objects in C# John, You missed his point. Then, exactly, what is his point? So break

Re: [ADVANCED-DOTNET] Partially constructed objects in C#

2003-06-19 Thread Stefan Holdermans
Stephen, Well, I don't think it's an issue of being correct here. The downside of the way it is implemented in .NET is that you can call a method of a partially constructed object---just as you have pointed out. The negative thing about the C++ approach is that you wind up with different

Re: [ADVANCED-DOTNET] Partially constructed objects in C#

2003-06-19 Thread Stefan Holdermans
Robert, I concur with a previous respondent who mentioned that it's simply a bad idea to call a potentially-overridden method from within your constructor, if that method does something critical to the object construction. Simply stating that is not enough, I'm afraid. The point is that,

Re: [ADVANCED-DOTNET] COM Interop and Threading

2003-06-19 Thread Stefan Holdermans
Chad wrote: Your performance problem may be related to your VB parameters being ByRef. This remembers me of all the problems I experienced in my VB6 days caused by the simple fact that parameter passing counterintuitively defaulted to by-reference... The company I worked for has published some

Re: [ADVANCED-DOTNET] Need to Append a line to an existing method

2003-05-31 Thread Stefan Holdermans
Howard, You might want to check out some of the interception examples that are out on the web... There's actually quite a lot of them... Furthermore, Don Box does a great job describing the CLR's facilities for method-call interception in his book on the Runtime [1]. Then there are also two

Re: [ADVANCED-DOTNET] Compilation question....

2003-02-28 Thread Stefan Holdermans
Simon, why is the comparison to 0 done twice? Well, you should think of the second 0 as the constant for false. So an expression x != 0 gets deduced like this: x != 0 !(x == 0) (x == 0) == false (x == 0) == 0 x == 0 == 0 You could also reason the other way around: what if

Re: [ADVANCED-DOTNET] Need help with a P/Invoke function

2003-02-27 Thread Stefan Holdermans
Ron, public struct RIBInterfaceEntry { [MarshalAs( UnmanagedType.ByValTStr, SizeConst=128 )] public string name; int entrytype; int subtype } You don't need the MarshalAs attribute here. System.String will be marshalled to a null-terminated string of ANSI characters by default.

Re: [ADVANCED-DOTNET] System.Delegate needs a new constructor

2002-12-03 Thread Stefan Holdermans
Jason, I'm not sure about b), but you can do a): just have a look at the System.Delegate.CreateDelegate method. HTH, Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jason Whittington Sent: Tuesday, December 03, 2002 5:47 AM To: 'Moderated

Re: [ADVANCED-DOTNET] dotNet alternative to mailslot ?

2002-10-30 Thread Stefan Holdermans
Jason, A little off the topic, is there any study/paper which compares the performance of C# to managed C++? I am curious to know if there are any performance differences bet. the two. Because of the way MC++ is compiled it's going to be almost impossible to draw anything meaningful from

Re: [ADVANCED-DOTNET] Applying custom attributes to assemblies in JScript.NET.

2002-09-24 Thread Stefan Holdermans
... --- Patrick Steele ([EMAIL PROTECTED]) Lead Software Architect Image Process Design -Original Message- From: Stefan Holdermans [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 22, 2002 5:01 AM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Applying custom attributes

Re: [ADVANCED-DOTNET] generic error handler / parameters passed

2002-08-27 Thread Stefan Holdermans
Keyen, This seems a popular feature these days... We had two threads dedicated to this issue the last weeks: you might want to check them out... Regards, Stefan - Original Message - From: Keyen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 25, 2002 6:04 AM Subject:

Re: [ADVANCED-DOTNET] using system.collections in .net

2002-08-21 Thread Stefan Holdermans
Linda, This is a collection of objects, so can the value in the value/key pair be a pointer to an object or do I need a more complex class. It can. I found a class called System.Collections.Specialized.NameObjectCollectionBase which seems to do the trick for the keying portion, but am

Re: [ADVANCED-DOTNET] Using Assembly.LoadFrom

2002-08-19 Thread Stefan Holdermans
and the app isn't running in the C:\Temp folder. Seems a bug to me. Or are we missing something here? Stefan - Original Message - From: Beaulieu, Paul To: 'Stefan Holdermans' ; Beaulieu, Paul ; [EMAIL PROTECTED] Sent: Monday, August 19, 2002 6:16 PM Subject: RE: Using

Re: [ADVANCED-DOTNET] Why has a MarshallByRefObject Stream.Read(..) byte[] as IN Parameter

2002-08-15 Thread Stefan Holdermans
Dirk, Actually, the correct CIL signature for Stream.Read is: .method public hidebysig newslot virtual abstract instance int32 Read([in][out] unsigned int8[] buffer, int32 offset, int32 count) cil managed { } The corresponding C#

Re: [ADVANCED-DOTNET] Why has a MarshallByRefObject Stream.Read(..) byte[] as IN Parameter

2002-08-15 Thread Stefan Holdermans
;-)) My regards Axel -Original Message- From: Stefan Holdermans [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 15. August 2002 14:52 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Why has a MarshallByRefObject Stream.Read(..) byte[] as IN Parameter Dirk

Re: [ADVANCED-DOTNET] XmlNodeChangedEventHandler

2002-08-12 Thread Stefan Holdermans
Steven, The NodeChanged event is raised when the mutation of the node is completed: by then, you cannot cancel the mutation by throwing an exception in the event handler. To prevent the mutation, you should handle the NodeChanging event instead: throwing an exception here, prevents the node

[ADVANCED-DOTNET] Scripting error in Framework Documentation.

2002-07-07 Thread Stefan Holdermans
Ok, this is miles off-topic and I'm sorry for that, but this one is really annoying me: I did a reinstall of Windows this weekend and after that I installed the .NET Framework SDK and SP1 on it. But now, I've some problems with the Framework SDK Documentation: every time I open an page of the

Re: [ADVANCED-DOTNET] protect component/library

2002-07-01 Thread Stefan Holdermans
Let's generalize the problem: What kind of licensing tricks should I apply in order to make sure that only the customer to whom I sold an app is going to use it? (I guess making sure this won't happen is far too ambitious --- but can we at least come up with a protection that is *difficult* to

Re: [ADVANCED-DOTNET] A bug in Thread.Abort()?

2002-06-22 Thread Stefan Holdermans
Looks more like documentation error to me... - Original Message - From: Luca Marchesi [EMAIL PROTECTED] To: Moderated discussion of advanced .NET topics. [EMAIL PROTECTED] Sent: Saturday, June 22, 2002 11:54 AM Subject: A bug in Thread.Abort()? Hy everybody. The SDK says If Abort is

Re: [ADVANCED-DOTNET] Reflection To Create Enum

2002-06-21 Thread Stefan Holdermans
Paul wrote: Is it Possible to create an enum Using Reflection? Yep... use the classes in the System.Reflection.Emit namespace. Alternatively, you can apply the CodeDOM. -- Stefan You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other

Re: [ADVANCED-DOTNET] Singleton pattern

2002-06-20 Thread Stefan Holdermans
Frank wrote: So we can say the static constructors are thread-safe, unless they end up calling static methods in other classes? And if they do this, the static methods need to be made thread-safe? I think that pretty much covers it. It's good practice to make your static methods

Re: [ADVANCED-DOTNET] Singleton pattern

2002-06-08 Thread Stefan Holdermans
Frank, (Sorry, I'm way late with this reply... I took a few days off and actually enjoyed other things than coding and thinking about it... ;)) On Thu, 6 Jun 2002 08:06:13 -0700, Frank Hileman [EMAIL PROTECTED] wrote: Regarding static var for singleton: I found that static vars are not

[ADVANCED-DOTNET] Weak References and Garbage Collection.

2002-05-18 Thread Stefan Holdermans
. Who can provide me with more information on this subject? Yours sincerly, Stefan Holdermans [EMAIL PROTECTED] You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.