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
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
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
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
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
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
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
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
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
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
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
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
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
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]
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.
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.
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;}}
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
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
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*:
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:
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
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
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
);
}
}
-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
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
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,
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
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
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
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.
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
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
...
---
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
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:
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
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
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#
;-))
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
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
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
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
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
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
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
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
.
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.
47 matches
Mail list logo