From 7732577887672903808
X-Google-Thread: f78e5,e8e0ab29e8861265
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2005 22:10:17 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: "Old Wolf" <oldwolf@inspire.net.nz>
Newsgroups: comp.std.c++
Subject: Re: If C++ had interfaces, what would they be?
Organization: http://groups.google.com
Message-ID: <1122432868.491291.73800@z14g2000cwz.googlegroups.com>
References: <dfadnU0KIovHJkbfRVn-3Q@speakeasy.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=202.27.193.8;
   posting-account=80nrlA0AAAD3f_mzr2sxD4I7mZKbONw7
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Tue, 26 Jul 2005 22:08:34 CST
Lines: 30
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-9Jn1v6ka27lAsDVIZALyb7UYxBwbdtd/6qRBWpkG2iTQxdzxiKxOUL0hGm4FIhgT1XxxXEj7Jsb0ptE!1Bp0rVS0oqqsMhD2mngr+nuDXLVMi4tIEet0CW4DGCeL3nNBHM9Vr7Xa/Lc1whmi6OfHdKfOC9Wk!YzlOGn/5G+SlmkXa8kgXWkqIPq7bHBs1KYGksd2LEQ==
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news1.google.com comp.std.c++:1515

Steven T. Hatton wrote:
>
> I'm wondering if there would be any advantage in attempting to formalize the
> notion of an interface as it relates to the #include directive.  I'm
> thinking that something along the lines of the OMG's IDL might serve as a
> starting point in designing such a feature.  I acknowledge that it might
> also serve as an example of why such a feature should *not* be introduced
> into C++.  One thing that is not clear to me is /what/, exactly, the term
> "interface" should mean in C++.  Is there any potential practical advantage
> to introducing a formal language construct called an "interface"?  What
> would that construct consist of?

C++ implementations of Microsoft's COM model do this successfully.
The interfaces are written in IDL. The interface importer program
converts this into a bunch of header files containing ABCs (abstract
base classes), one for each interface.

When you want to design a class implementing those interfaces, you
simply multiply derive from those ABCs.

IMHO, C++ is flexible enough to allow good implementation/interface
separation already. But it does not try and shove programming
principles down the coder's throat like Java does.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



