Board index » delphi » Delphi vs Visual Basic for writing COM !

Delphi vs Visual Basic for writing COM !

Hi everybody,

My boss is planning to abandon Delphi for writing COM and OLE Automation
components.
He has proposed to use Visual Basic because it is easier to manage all
things and it is faster about producing code.
I think that it is much better keep using Delphi, but i don't have
enough documentation to proove it.
Why is it better to use Delphi instead of Visual Basic to write COM and
OLE Automation components ??????????????????
Cheers.
                                 Stefano

 

Re:Delphi vs Visual Basic for writing COM !


Flexibility.  VB does do a bit more for you, but doesn't allow as much fine
grain control or richness in the implementation detail.  Example?
Collections.

Implementing collections [that support for each enumeration etc] in VB is
straightforward (I am told).  In Delphi you have to roll your own
implementation more or less from first principles.

However, once you have implemented such a collection, you can then re-use
that implementation via inheritance, so achieving the same effective
simplicity as VB.  "So what?" your boss will say, "collections are still
easier in VB, we don't have to do any pre-coding of base classes or anything
etc."

At which you point out that collections are just one example of an interface
implementation.  Point out that if your object model will benefit from
implementation inheritance in delivering the object model more rapidly and
effectively, then VB is going to hinder more than help.

You might also mention the arbitrarty changing of GUIDs that VB indulges in
when building certain COM objects.  This can lead to all sorts of fun.

--
Jolyon Smith
Neot Software Services Ltd.
http://www.neot.co.uk
yahoo messenger ID: jolyonsmith

Re:Delphi vs Visual Basic for writing COM !


As far as I know you _can_ inherit from other classes in VB. It is possible
in VB6 and will be further developed in next versions of VB.
And, even though I now use Delphi, I would not agree that Delphi is better
from COM than VB (consider returning collections as function results -
VBCollection is the same as Collection in COM and TCollection is not at all
compatible and can not be returned as COM method result).

Huckey

Re:Delphi vs Visual Basic for writing COM !


No, VB6 has no inheritance built in it.  VB7 will have some (beacuse the
.NET architecture requires it).  You can implement interfaces which gives
you some extending abilities, but it is not true inheritance.

--
Christopher Brandsma
Knosys Inc.

Quote
Jacek Szymanski <jacek.szyman...@bertelsmann.pl> wrote in message

news:39e5b84c_1@dnews...
Quote
> As far as I know you _can_ inherit from other classes in VB. It is
possible
> in VB6 and will be further developed in next versions of VB.
> And, even though I now use Delphi, I would not agree that Delphi is better
> from COM than VB (consider returning collections as function results -
> VBCollection is the same as Collection in COM and TCollection is not at
all
> compatible and can not be returned as COM method result).

> Huckey

Re:Delphi vs Visual Basic for writing COM !


Quote
"Jacek Szymanski" <jacek.szyman...@bertelsmann.pl> wrote in message

news:39e5b84c_1@dnews...

Quote
> As far as I know you _can_ inherit from other classes in VB. It is
possible
> in VB6 and will be further developed in next versions of VB.

I suggest you check your sources.  It is _not_ possible, not even in VB6.
There is a risible "Class Wizard" which gives the impression that you can
derive classes from existing classes, but all this does is copy the
implementation and save it with a new name ready for you to add the new
stuff.  There is no on going relationship between the two classes for the
purposes of implementation inheritance:  need to change the implementation
in the "base class" - e.g. to fix a bug - then you have to change it in the
derived class(es).

Quote
> I would not agree that Delphi is better
> from COM than VB (consider returning collections as function results -
> VBCollection is the same as Collection in COM and TCollection is not at
all
> compatible and can not be returned as COM method result).

True.  But my ICsBaseCollection can.  And I can derive new implementations
from TCsBaseCollection very, very quickly (we are talking 1 or 2 minutes).
I can also derive new TCsVisitors and TCsSubscribers and TCsControllers and
TCsViewers just as quickly.

Delphi is better for COM if you are _building_ systems which implement and
expose sophisticated object models.  VB is probably better (correction:
easier - not necessarily the same thing.  It's easy to fall off a log) if
you just want to "consume" objects.

--
Jolyon Smith
Neot Software Services Ltd.
http://www.neot.co.uk
yahoo messenger ID: jolyonsmith

Re:Delphi vs Visual Basic for writing COM !


Whether Delphi or better than VB for COM development depends on what type of
applications you build. I have used both to do COM development for a long
time and they're both useful in given situations. In general, if you're
doing simple, stateless, single-level classes for business layer or data
layer functionality, VB is easier, cheaper, and works well (although this is
also easy in Delphi).
If you care a lot about class implementation inheritance, type library
control, simple access to low-level COM interfaces, low-level
multithreading, Delphi is easier, cheaper, and works well.

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"Stefano" <warx...@yahoo.com> wrote in message

news:39E56CA6.8A952797@yahoo.com...
Quote
> Hi everybody,

> My boss is planning to abandon Delphi for writing COM and OLE Automation
> components.
> He has proposed to use Visual Basic because it is easier to manage all
> things and it is faster about producing code.
> I think that it is much better keep using Delphi, but i don't have
> enough documentation to proove it.
> Why is it better to use Delphi instead of Visual Basic to write COM and
> OLE Automation components ??????????????????
> Cheers.

>                                  Stefano

Re:Delphi vs Visual Basic for writing COM !


One important differnce is that VB6 only support apartment-threaded
COM-objects but Delphi support both Free and Both threaded. Enables you to
build much faster websites in some systemdesigns.

  And as pointed before, inheritance can help you a LOT if you have many
similar business objects - as in a standard e-business site.

 I have saved 1000's of lines of codes with inheritance... and much nicer to
maintain too :)

Re:Delphi vs Visual Basic for writing COM !


I guess that this topic of simplicity is the best weapon the vb
programers have , but this simplicity has a price , check out the book
writing distributed applications  with com + and vb 6(microsoft press),
a lot of the problems caused by simplicity are exposed here, for example
you can only  write  STA com application servers with VB , you cant
write monikers, vb cant produce components that create pooleable objects
due to the "thread affinity", and finally a setabort method bug with
multiobject transactions, these are some of the problems the simplicity
causes and much of then are related to the threading model VB uses, if
you want to use any of the features written  above you should use visual
C++ and this will take  more  time and resouces for achiving the
funcionallity that  Delphi offers. I'm not against VB, i guess that no
tool is perfect at all, but Delphi gives the power and simplicity that
any programer needs.
Quote
Stefano wrote:

> Hi everybody,

> My boss is planning to abandon Delphi for writing COM and OLE Automation
> components.
> He has proposed to use Visual Basic because it is easier to manage all
> things and it is faster about producing code.
> I think that it is much better keep using Delphi, but i don't have
> enough documentation to proove it.
> Why is it better to use Delphi instead of Visual Basic to write COM and
> OLE Automation components ??????????????????
> Cheers.

>                                  Stefano

Other Threads