|
h o m e s c h e d u l e a r c h i v e s f o r u m c h a t f a q t o o l s a b o u t dr. dobbs journal |
TechNetCast @ SD'98 East Cross-Platform COM
MS COM has spread out from its Windows roots and is now widely available on
other platforms. Christian Gross explains the challenge of providing
native COM implementations and gives us a status report on the availability of these
implementations on non-Windows operating systems.
Christian Gross is an Internet expert who has the ability to share his technical vision with management and IT professionals. He regularly speaks at professional developers conferences such as Visual C++ DevCon, Microsoft DevDays, Internet Expo 97, and Java DevCon. Christian also writes articles for technical magazines. As an IT consultant, Christian has advised such companies as the National Westminster Bank, Magna International, Standard Life, and the Union Bank of Switzerland. He maintains a website. Check out Christian's Microsoft Developer Network article: Building COM Components on UNIX This interview is part of a series of discussions with leading programmers broadcast live from Software Development 98 East, August 18-20 1998. Interviews by Philippe Lourier. Post and read comments about this interview on the TechNetCast forum. |
||||||
|
TNC: Christian, welcome to TechNetCast. Let’s dive into the topic at hand. COM is a specification, a protocol for interface negociation between objects. This means that COM can conceivably be implemented on any platform, by any vendor. CG: Yes, absolutely. People say COM is cross platform --yes and no. Imagine we took Java and had COM embedded in our Java VM. Well, that Java component can be run on a UNIX box untouched, unchanged. Even though it uses COM. TNC: You say it uses COM. What does that mean, exactly? Somehow, objects communicate using COM as a protocol? CG: Exactly. The reason people get the misconstrued notion that COM isn’t cross platform is that a component compiled with VC++ or C++, of course, isn’t cross platform. If I took the source code of that C++ and moved it over to UNIX and then compiled it, it would work in the same way. TNC: Yes, but part of COM is the plumbing, the glue, the actual implementation provided by Microsoft, for example, in the case of the Windows implementation. This needs to be present on the other platform in order to work. CG: Exactly. TNC: You can’t just take any Java class that has an embedded COM component and run it on other platform. Someone needs to provide the plumbing to make all this work. CG: Exactly. That is actually the key piece. COM is not cross platform if the plumbing isn’t available. But, the crux of the situation is that it is available now. There are multiple vendors. They are all coming out. They all have it. It’s here today, it’s feasible. TNC: Let’s run through different platforms and see what implementations are available. Is it correct to refer to these as "COM implementations"? CG: Yes, lets call them COM implementations. One thing we must point out, however, is that some of the implementers don’t do just COM, they also do Windows. They provide Windows GUI implementations. TNC: Ok, what is available on the UNIX front? CG: On Solaris, Software AG and MainSoft provide implementations. I think Bristol is coming out with something. [But, considering their news, we’ll have to see.] There are a lot of companies that are there. IONA is doing things differently. They are actually providing a bridge between COM and CORBA. Vendors like MainSoft or Software AG provide a native COM layer. You can take a component written on the Windows side, move it across, compile it, run it and you’re off to the races. Software AG provides a port for mainframes… no problem. Linux: Software AG has brought out a beta. I found something out while talking to Microsofties: let’s say you want to port COM to the Amiga. Well, go to the Open Group and they’ll give it to you. You port it, it’s yours, it’s done. TNC: How complete are these implementations? CG: Very complete. Again, but we must distinguish between two things. Let’s say I want to write a Hello World MFC application that pops up "Hello World". Well, the Software AG implementation doesn’t allow you to do that because it doesn’t have the GUI portions of the Windows library. But if I wanted to write server side components, an I think in most cases this is what I want to do, the Software AG implementation is fine. TNC: I assume you can’t use MFC if it’s not available on the other platform. Code that makes Win32 calls is also not portable. Is that correct? CG: Partially… GUI support is really the distinguishing factor here. If I want to create a thread through Software AG, I can do that. Anything that is GUI-less can be done on UNIX or mainframe platforms. TNC: So a COM component can call the Win32 function CreateThread(), for example. And that functionality is provided as part of the COM implementation on the target platform. CG: Yes. TNC: So these implementations need to support a large subset of Win32. CG: Absolutely. They support a large subset of Win32. That’s why in a way you could reverse engineer. That is what the Linux WINE project is about. It can be done. But, if you want to make a sensible business case, it would be better to go to Microsoft or to the open group and say, I want to do it myself. TNC: Is it possible to create a thread through COM rather than Win32? Code that calls the Win32 function CreateThread() should not be portable, period. CG: Well, you’ve touched on one of the issues on COM and threading. Let’s look at the MainSoft approach. MainSoft has licensed the entire libraries from Microsoft and they have port them. But they only support threads if the native platform supports threads. For example, Solaris supports native threads. Software AG says "we are going to provide threads whether you like it or not". Linux supports P-threads. P-threads cannot be totally considered true blue threads, so you have to include a thunk layer. Every platform has its own dynamics. Solaris has native threads, so its not an issue. If you have a platform where they are no native threads, yes, then this becomes an issue. You have to think about what you are going to do and how you are going to do it. TNC: OK, there are now COM implementations available on different platforms. How far along is the work of porting existing COM components to these implementations to these platforms, or creating new components? And what have we learned in the process of writing these COM components? CG: There are a couple of things that I have learned from working on the UNIX platforms. You’ve got to know UNIX. Don’t try this if you don’t know UNIX. And you’ve got to know NT. You have to know both platforms. You can take the source and move it over and then compile it. […] If you start doing some really funky things with threading and custom marshaling and URL monikers and all of these weird things, yes, then you have to be a much more experienced UNIX person. But if you are doing application programming, which I think is what the vast majority of the people who are going to be interested on COM on other platforms will be doing, then know that platform and just program as if you were programming a business application. TNC: This can conceivably be a team effort. The component can be developed under one platform and then ported to the other platform and optimized by people that have experience with that platform. CG: We also found out that people don’t tend to port that often from Windows to UNIX. That’s not the trend. Most people want access to some business logic sitting on the UNIX side. That’s where they would actually use COM. That component would then be called via DCOM and made part of the overall architecture. TNC: Christian, you have a book coming out. CG: It’s coming in two months. It will be published by Addison Wesley. TNC: What is the title? CG: Something like "Web COM Patterns"… It’s a book about building web applications using COM and Patterns. TNC: You don’t get to choose the title? CG: Well, I can make recommendations, but in the end they decide what would represent the book the best. TNC: Okay, and you have a web site. CG: Yes, www.eusoft.com. TNC: Christian, thank you very much for joining us today. More TechNetCast @ SD'98 East Interviews Copyright (c) 1998, Dr. Dobb's TechNetCast [HOME] |
|||||||