Re: I really hate .NET especially inside Delphi



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)
.



Relevant Pages

  • Re: I really hate .NET especially inside Delphi
    ... 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 ... So I didn't know namespace support is even worse in Delphi. ...
    (borland.public.delphi.non-technical)
  • Re: VCL -> XAML or VCL -> WinForms -> XAML
    ... The fact that you can use WinForms components on a VCL form but can't ... > is only interesting for Delphi developers and leverages constructs ... > over other .NET languages. ... Then there is my admitted preference for Borland tools ...
    (borland.public.delphi.non-technical)
  • Re: Chrome unveiled to the public
    ... > And All is is well with Delphi in Win32... ... nor have I used any of the pure .Net languages for anything serious. ...
    (borland.public.delphi.non-technical)
  • Re: I really hate .NET especially inside Delphi
    ... I'm not understanding -- what are you talking about? ... .Net languages handle it. ... In addition -- these are pretty small complaints, ...
    (borland.public.delphi.non-technical)
  • Re: Interesting article about namespace support
    ... > Did you miss your "comared to other .NET languages" there? ... It actually compares Chrome to Delphi, ... (and since it was written by Marc, that is completely legitimate, IMO, ...
    (borland.public.delphi.non-technical)