Re: I really hate .NET especially inside Delphi
- From: "Tim Jarvis [Borland/DTG]" <tim.jarvis@xxxxxxxxxxx>
- Date: 4 Oct 2006 05:05:11 -0700
Robert Giesecke wrote:
You cannot "use" a namespace in Delphi.Net from a Delphi.Net compiled
assembly. Which is one of my points why I consider units in D.Net a
poor trade-off compared to namespaces in the usual way .Net languages
implement it. You have to use units.
Actually you can, it just might not be obvious, and sounds like I
should do a camtasia on this sometime.
Ok, to create an assembly that looks and feels like a C# assembly, in
Delphi.NET terms this is a package (yeah, yeah, I don't know why
either, but it is what it is) a Delphi.NET package does not compile to
a BPL it will compile to a dll, in otherwords an assembly.
Now say we creat a class in there lets call it TTestClass in the
namesapce TimsTest i.e Unit TimsTest.TTestClass, if you compile this
"package" and have a look at the created assembly with reflector you
will see a namespace called TimsTest with TTestClass in it, if you
reference this assembly in a C# project you simply would reference this
class via TimsTest.TTestClass or put a using clause in i.e. Using
TimsTest, in a Delphi app in the Uses class you would put
TimsTest.TestClass...this is some additional scoping, this is
deliberate, but not an artifact of the assembly, but Delphi, it
actually determines the unit name by reflection...if you look closely
at the assembly you will see a class attribute called TUnitName with
the scoped name passed as a parameter.
So yes, its different from C#, but the assembly is perfectly valid, and
works just the same as a C# assembly...just has some additional Delphi
unit naming attributes that the Delphi IDE uses is all.
Also, don't confuse C# and VB.NET with the "usual way .NET languages
implement things" sure these are by far the most common .NET languages,
but there are some really obscure things out there that do stuff waaay
differently, have a look at some of these interesting
beasts....http://www.dotnetpowered.com/languages.aspx
--
Tim Jarvis
Product Evangelist APAC Team Lead (DTG)
.
- Follow-Ups:
- Re: I really hate .NET especially inside Delphi
- From: Robert Giesecke
- Re: I really hate .NET especially inside Delphi
- From: Chad Z. Hower
- Re: I really hate .NET especially inside Delphi
- From: Rick Beerendonk
- Re: I really hate .NET especially inside Delphi
- References:
- I really hate .NET especially inside Delphi
- From: AnnShip
- Re: I really hate .NET especially inside Delphi
- From: Robert Giesecke
- Re: I really hate .NET especially inside Delphi
- From: Nick Hodges (Borland/DTG)
- Re: I really hate .NET especially inside Delphi
- From: Robert Giesecke
- Re: I really hate .NET especially inside Delphi
- From: Nick Hodges (Borland/DTG)
- Re: I really hate .NET especially inside Delphi
- From: Clinton R. Johnson
- Re: I really hate .NET especially inside Delphi
- From: Nick Hodges (Borland/DTG)
- Re: I really hate .NET especially inside Delphi
- From: Bruno Fierens [tmssoftware.com]
- Re: I really hate .NET especially inside Delphi
- From: Nick Hodges (Borland/DTG)
- Re: I really hate .NET especially inside Delphi
- From: Rick Beerendonk
- Re: I really hate .NET especially inside Delphi
- From: Robert Giesecke
- I really hate .NET especially inside Delphi
- Prev by Date: Re: Looking good
- Next by Date: Re: Understanding Borland
- Previous by thread: Re: I really hate .NET especially inside Delphi
- Next by thread: Re: I really hate .NET especially inside Delphi
- Index(es):
Relevant Pages
|