Jump to content

Talk:Interface (object-oriented programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by HotMess (talk | contribs) at 13:54, 14 November 2022 (Proposed merge of Interface (Java) into Protocol (object-oriented programming): Reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Start‑class High‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
HighThis article has been rated as High-importance on the project's importance scale.

Disputed sense of protocol

The term protocol in object-oriented programming means more than just the signatures of the methods owned by a given class. The protocols of a class include how that class expects to be used, viz. the order in which methods expect to be invoked. This is now recognised, for example, in UML 2.x statecharts, where the term protocol machine is used to describe the state machine of a class, representing legal sequences of method invocations. This behavioural use of protocol goes back to Smalltalk days (although in some contexts, the weaker sense below was intended).

In the mid-1980s, the programming language Objective C introduced the term protocol as a syntactic term to denote an abstract interface, containing method signatures only, defined independently of the single-inheritance class hierarchy. This usage is more or less synonymous with the syntactic construct interface in Java, and was invented for a similar reason (viz. the desire to support only single inheritance, for convenience of implementation, but still allow multiple classification).

So, I would like to argue that the neutral definition of protocol should refer to the deeper, behavioural sense; and the Objective C usage (which is a specific syntactic term in the language) be moved to a page that discusses object-oriented interfaces in a neutral way, which subsumes interface (Java) and protocol (Objective C); and possibly also concept (C++ standard template library). AJHSimons (talk) 15:51, 18 February 2008 (UTC)[reply]

Exactly what I perceived about "protocol"! Protocol should be about the behaviour, about the (abstract) state of the system/object. In particular, it should tell the user/client how to use the object, in what order the methods must be called, not just what methods the object provides. Lê Harusada (talk) 03:45, 30 October 2011 (UTC)[reply]
I think the historical "weak" sense of "protocol" used by Objective-C and implicitly by SmallTalk was due to the overstatement of the method invocation as "messaging between objects". Thus, the Java's interface simply defines the messaging protocol between objects, even though partially. Hence, I think the good old SmallTalk and Objective-C should be mentioned in the article instead of the mordern Java! Lê Harusada (talk) 05:35, 30 October 2011 (UTC)[reply]
Support. A "protocol" requires a description of the behavior, of the states at both sides and not merely of messages. The proper term here - IMO - is "interface" / "abstract interface" - to show that the formal specification of (abstract) methods does not qualify for a "protocol", but is only a part of what is possibly a specification of a communication protocol. AFAIK, it has always been "separating interface and implementation", not "separating protocol and implementation". To use "protocol" here is confusing and misleading. 62.178.250.9 (talk) 14:47, 17 March 2014 (UTC)[reply]

Merge with interface (Java)

Regarding merging it with Protocol_(object oriented programming)... This article is fine the way it is. I was searching it, and found it in one go without having to dig through protocol --> object oriented --> java --> interfaces. 70.113.115.138 04:46, 20 February 2007 (UTC)[reply]

The Interface is a Java term, not necessarily an object oriented programming term. Other languages use other terminology for similar technologies. This entry might reference the OOP protocol entries but should remain separate. Dblatt 13:21, 18 April 2007 (UTC)[reply]

I agree with the above opinions. I had no idea what a Java Interface was, nor that it was related to OOP Protocol. I searched for it and found it easily this way.--89.180.27.21 20:15, 3 May 2007 (UTC)[reply]

Due to the fact that this article is flagged to be 'wikified', I believe that merging this with Interface (Java) would only serve to degrade the quality of that article. Ph0t0phobic 23:13, 1 June 2007 (UTC)[reply]

I am not saying that the Interface (Java) article is bad, but there just is no place for it.
The Java term "interface", which is also adopted by many other OOP languages, is equivalent to "protocol" as defined by this article; indeed, the lead section even lists it as a synonym. Given that the functionality of interfaces in all the Java-derived languages is the same as the one described by this article, there is no reason we should have this article and a separate Java-specific one separately. Having two articles on the exact same topic can only serve to fragment Wikipedia and duplicate effort.
The merge needn't degrade the quality of either article: the whole point of merging is to choose the good and throw away the bad. I am hereby re-introducing the merge tags. -- intgr #%@! 07:39, 28 August 2007 (UTC)[reply]

I agree with the opinions to keep this page seperate. The fact that it is a Java specific topic is the ultimate reason why I think it should remain seperate. The Protocol page should remain generalized and should have no specific indication of language dependancy, except for maybe in examples, in which case appropriate comments should be made. Alex 18:41, 28 September 2007 (UTC)[reply]

How are interfaces Java-specific? So I suppose we should write interface (C++), interface (C sharp), interface (Object Pascal), etc too? And well interfaces is hardly the only feature of programming languages, why why not array (Java), array (C++), array (Pascal), array (Perl), array (Python) ad nauseam. Because this is exactly what you're proposing here!
Interfaces in Java are not special, the article is just an unnecessary content fork. -- intgr [talk] 12:30, 29 September 2007 (UTC)[reply]

Merge with concepts in C++ STL

No point in having separate articles for each language - one thinks of C# interfaces, and C++ concepts that will become standard in 2009 (see Concept (generic programming) and C++0x#Concept). Well, same thing; this article should explain the general idea and give a couple of examples to illustrate its implementation in each major language (and not to serve as a comprehensive programming guide). That is: Interface (Java) should be pruned a bit and merged from. GregorB 22:14, 3 October 2007 (UTC)[reply]
Yes, and everything that's left of Interface (Java) after "pruning a bit and merging from" would be simply a tutorial, and should be deleted anyway (WP:NOT#Wikipedia is not a manual, guidebook, or textbook). That's what a merge is. -- intgr [talk] 21:01, 7 October 2007 (UTC)[reply]

Java interfaces are completely related to interfaces in other languages and C++ pure virtual functions and all fall back into the definition given in this article, and should be merged.

That being said, C++ concepts are not quite the same. Concepts in C++ will define a set of requisites for a given metaprogramming template, that is in a different level than Java interfaces, C# interfaces or C++ pure virtual methods. The latter define an specific message, while the former does not require the existence of a message. A C++ concept may define that there is a + operator that applies to class A and class B, but it does not require an A& operator+( const B& ) method in A class definition, the same functionality can be expressed in any other way, like an out of class A operator: A& operator+( A&, const B& ), thus a concept may not require a definition of a message between two classes (as the latter operator is not even part of any class). While the example may seem quite subtle, C++ concepts can define non-message requirements like the existence of an internal type definition in the class. (From C++0x#Concept):

concept InputIterator<typename Iter>
{
  typename value_type;
  typename reference;
  typename pointer;
  typename difference_type;
  // ...
}
that requirement is not a message definition of any kind, but a helper for metaprogramming. I don't believe that this article and Concept (generic programming) should be merged. —Preceding unsigned comment added by 85.49.192.58 (talk) 20:25, 31 October 2007 (UTC)[reply]
If I understand correctly, protocol would be more or less synonymous with interface, but not with concept, which, in fact, subsumes protocol because it also defines internal organization of a class, not just its outward appearance. This would indeed be a substantial difference, so I think you have a good point here. GregorB (talk) 13:14, 22 November 2007 (UTC)[reply]
Also, in your previous example, an int could be class A and a double could be class B, even though int doesn't have any explicit operator+ (it's built into the compiler), and int wouldn't be explicitly "implementing the addable-with-B interface". I believe that's another important difference with interfaces. 200.127.223.79 (talk) 03:10, 1 June 2008 (UTC)[reply]

I think interface is the more common term

When a programmer says ‘interface’ they almost always mean this unless explicitly prefixed by ‘user’. But when he says ‘protocol’ he'll be talking about http and such. Shinobu (talk) 18:57, 6 September 2008 (UTC)[reply]

I think this is incorrect. Programmers usually use the term "interface" in the sense it is used in the phrase "program to interfaces, not implementations" from the Gang of Four's Design Patterns book. Erich Gamma, one of members of the Gang of Four, makes it clear that "interfaces" in this context means APIs, not protocols. See for example the second paragraph of his response to the second question of the interview at http://www.artima.com/lejava/articles/designprinciples.html. The distinction between protocols and APIs is sometimes lost to Java programmers because protocols are the most natural way to separate implementation from interface in Java, and because Java uses the term "interface" to refer to protocols. In other languages (at least Objective-C, I'm less familiar with C++ and C#), a separate header file is typically used instead of protocols to separate interface from implementation. The confusion Java fosters between "interfaces" in the usual (Gang of Four) sense and "interfaces" in the Java sense (i.e. "protocols") makes it all the more important for this article to retain the term "protocol" as to be separate from any Java-specific "interface" article. — Preceding unsigned comment added by 2620:0:1000:1B01:992C:E1EB:357A:B769 (talk) 22:33, 7 June 2012 (UTC)[reply]

Victim of Misunderstanding

This page is clearly the victim of merging by people who are not knowledgeable in the field. A protocol is not the same as an interface. At best an interface might be an element of a protocol. Interface is a common term among computer programmers which denotes a set of method signatures with no included implementation. It has a very clear concrete meaning which is distinct from that of a protocol, which is much more broad. While they might server similar purposes, ie that of abstraction and creation of a contract for the purpose of communication, they are very different animals. They are different in about the same way that a bicycle is different from a freeway. Waylonflinn (talk) 23:04, 7 October 2011 (UTC)[reply]

I strongly agree. A protocol is a sequence of messages or actions by which something is negotiated or performed: for example, TCP/IP is a protocol. (You might use a UML sequence or activity diagram for it.) An interface in the Java sense is just a collection of method signatures. (You might use UML class diagram for it.) Protocol is a comms term.Rick Jelliffe (talk) 09:39, 2 April 2018 (UTC)[reply]

This article is meant to be about the object-oriented concept of protocols, no communication protocols. The former are named in analogy to the later but exist independently and are significantly different. I think the Waylonflinn comment you were replying to is a reference to the fact that people are editing this article without a full understanding of the different between object-oriented protocols and interfaces, not a claim that interfaces aren't protocols because they're not communication protocols, even though they indeed are not that either :-). TFJ76 (talk) 11:33, 11 November 2022 (UTC)[reply]

Only some languages

Oh, I think I see the problem. This page claims that protocol is a specialist name for a kind of interface used in Object Oriented Programming. However, it seems that only a few OOLs uses this term: Objective C, Swift etc. Hence the mystification that programmers from other languages are registering. (Is there any other language that might prove that it is a general term?) Rick Jelliffe (talk) 09:50, 2 April 2018 (UTC)[reply]

I have bitten the bullet, and rearranged the article:

  • All the non-OO material is put under a separate heading. Why is it even there?
  • I have rewritten the top sectiont to say that protocol used in a variety of specialist senses, as well as its more general sense. And added the examples of this: objective-c, swift, clojure, elixir

However, what is still perhaps missing is details that each of those languages mean something different by protocol. In clojure, it means a kind of dynamic dependency injection, my superficial research is that in objective C is an interface, in elixir it is dynamic dispatch, and in swift it seem more interface/traits/mixins.

So I hope my edits sort out the controversy better, and allow more improvements without arguments on words.Rick Jelliffe (talk) 11:06, 2 April 2018 (UTC)[reply]

I'm afraid this edit, valiant as it was, might do more harm than good. A protocol is an object-oriented programming concept that is known by the term "protocol" in some programming languages, notably in Smalltalk where I think it originated, by the term "interface" is some other programming languages, and by other terms elsewhere (though not "Trait", that's a somewhat related but different concept). Only some programming languages directly support protocols (or its "interface" equivalents) but it's a concept totally independent of any programming language and that could potentially be implemented in a program using almost any language. Thus starting the article with the statement "Protocol is a term" is both incorrect and confusing. This confusion is evident in the rest of the article after your edits, and to some extent even in your talk post above, because once the article sets out to document "protocol" as a term in some programming languages then the subtle distinction between the uses of that term in different languages or the use of different terms in different languages for similar concepts dominates, when these interesting but peripheral topics should be addressed but should neither form the bulk or the article not find their way into its leading sentence. WP:NOTGUIDE might require that, but mostly I think presenting things this way buries under implementation details the real value of this article, an explanation of the concept of "protocol", by whatever name, term, or keyword that concept is known.
As I think this talk page shows, a proper explanation of protocols is rendered difficult by the fact that many programmers have not been exposed to protocols as a clear concept distinct from any implementation (see Victim of Misunderstanding above). Many are coming to this article from Java's interfaces, which can be used to implement protocols but also programming interfaces, hence the corresponding keyword and concept's name in Java. That Java concept of "Interfaces" is significantly different from the general object-oriented programming concept of "Protocols", even though the former is used to implement the later in Java, and that is confusing to many. This confusion is all the more reason to have this article focus on the concept and not get lost in naming and implementation details.
A good model is the article Constant_(computer_programming). Like "Protocol", "Constant" is a programming concept independent of programming languages. In some languages it's implemented using the keyword "constant" or "const", while the keyword "final" is used in some other languages (notably Java), and still other keywords or implementation mechanisms are used in other languages. But the article Constant_(computer_programming) focuses first on the concept known by the name "constant" and not on the term "constant" and its variations, and it discusses particular language names and implementations only after the concept is well explained.
The confusion resulting from treating "protocol" as a term rather than a concept will exist regardless of whether that concept ends up getting called "protocol", "interface", or anything else in this article. I think there are some good reasons to prefer the term "protocol" (it's as far as I know the original term used for that concept, it avoids confusion with programming interfaces, and it provides a good analogy to communication protocols), but that's a topic for another section of this talk page (and by the look of it, most sections of this talk page :-).
I think a further edit is needed. Ideally this edit would cite references for both the origin of the concept and the history of the different terms it's associated with. Ideally also I would have the time and ability to do this myself but that's not the case right now :-). Thanks for your edits and hopefully it will advance the article towards an even better final form. TFJ76 (talk) 11:18, 11 November 2022 (UTC)[reply]

Protocol?

Never heard of Interfaces being called Protocols ever, must be only on a few select languages. 200.3.193.162 (talk) 16:01, 8 October 2018 (UTC)[reply]

I do not think Java's interfaces are sufficiently special to deserve their own article.

n.b. in 2007 there was a discussion about doing this in the other direction, which a surprising (to me) number of people were against. 3mi1y (talk) 07:27, 7 November 2022 (UTC)[reply]

Merge. The concept as implemented by Java is not meaningfully different from other OOP languages. A large portion of the Interface (Java) article seems inappropriate per WP:NOTGUIDE. (As it happens, I've never heard the term "protocol" used this way, but the article appears to be the correct target regardless.) WPscatter t/c 07:31, 7 November 2022 (UTC)[reply]
"Interface" is also the term I'm familiar with, but I'm willing to believe that people who learned the concept through other languages know the same thing by a different name.
"Interface" is probably the most common these days if only because of the sheer popularity of Java. 3mi1y (talk) 07:37, 7 November 2022 (UTC)[reply]
Probably, yeah. I'd have to look into it but I might even support moving this page to Interface (object-oriented programming), but that's another discussion altogether :) WPscatter t/c 07:39, 7 November 2022 (UTC)[reply]
glances up at the rest of this talk page
This might be the most controversial thing I ever propose here, but here we go... 3mi1y (talk) 07:47, 7 November 2022 (UTC)[reply]
Oppose with comment. As per this reply of mine on the 'Requested move' thread, perhaps it might be best to rework Interface (Java) into a more general 'Interface type' article, keeping this article about whatever a 'Protocol' actually is (again, still not entirely sure what the concept of a 'protocol' is supposed to be, but the article is starting to give me the vibe that a 'protocol' is 'the way in which classes are designed to communicate with each other (often through the medium of interface types)', rather than 'a different name for interface types').
Additionally, making it an 'Interface type' article would directly address the notability issue, as, whilst Java's interfaces by themselves aren't that notable, an article containing a brief discussion of interface types, and how this functionality is present in multiple languages, would be a bit more justifiable (a la Enumerated type, Function type, Abstract type, etc). 🔥HOTm̵̟͆e̷̜̓s̵̼̊s̸̜̃🔥 (talkedits) 13:00, 14 November 2022 (UTC)[reply]
I actually kind of like this. It's roughly equivalent, while sidestepping the whole "what even is a protocol" thing that we're all stuck on.
If we go this route, I might AfD this one later, unless someone comes along who can explain the difference in more than just "vibes" (because, while I get approximately the opposite vibes from you, they are still just vibes). That can be a problem for future-us, though. mi1yT·C 13:27, 14 November 2022 (UTC)[reply]
Well, I've mentioned the 'Rework the Java interface article to make it not Java-only' idea on Talk:Interface (Java) (haven't formally proposed moving that article/starting the rework of it just yet), seeing as that idea involves changing that article.
However, upon reading some of the other threads on this talk page (especially considering @TFJ76's very recent clarifications on a couple of the older threads), it looks like this article probably isn't AfD-worthy, just in need of a hefty rewrite to make it say a bit more clearly what a protocol is, removing the tangents trying to explain interfaces. 🔥HOTm̵̟͆e̷̜̓s̵̼̊s̸̜̃🔥 (talkedits) 13:54, 14 November 2022 (UTC)[reply]


Requested move 7 November 2022

Protocol (object-oriented programming)Interface (object-oriented programming)WP:COMMONNAME.

This is shockingly controversial. The entirety of the talk page is people being confused by the title and other people defending the title. But - I suspect mostly because of Java's popularity - "interface" is the more commonly used term.

Google results for interface oop: "About 9,450,000 results"

For protocol oop: "About 7,080,000 results"

Selected other references:

3mi1y (talk) 08:13, 7 November 2022 (UTC)[reply]

Support per nom.--Ortizesp (talk) 17:05, 7 November 2022 (UTC)[reply]
Support with comment: How related are the concepts of "protocol" and "interface" anyway? The way this article describes protocols (which is notably unsourced), it does indeed seem more akin to a communication protocol—I've never known interfaces to describe things like message format. I think the best thing is going to be rewriting the bulk of this article at Interface (object-oriented programming), with a short section talking about protocols in languages like Swift. Or, if significant notability can be established for "protocol" as independent from "interface", they should be two separate articles. But that does not seem to be the case. WPscatter t/c 17:45, 7 November 2022 (UTC)[reply]
I don't know. The article itself seems confused by this:
Protocol is a term [...] which other languages may term interface
When used otherwise, "protocol" is akin to a communication protocol [emphasis mine]
Some programming languages provide explicit language support for protocols/interfaces
I read these as "this sense of the word is the same thing as an interface, but there's another thing called communication protocol and that's a different thing with its own article".
But then it occasionally goes back to talking about the latter anyway: (For the communications-style usage only:) The call sequence and decision points of the methods
And arguably confuses it with a third thing (design by contract): The invariants that are preserved despite modifications to the state of an object.
The only thing I see supporting a separate article on protocols in this sense is:
Note that functional programming and distributed programming languages use the term protocol akin to the communications usage
I haven't used whatever languages this is referring to, so this may or may not be enough of a thing for a separate article (vs a "some languages add more stuff to this" section); I'd have to do more research to form an opinion. 3mi1y (talk) 18:51, 7 November 2022 (UTC)[reply]
The many references to communication protocols in this article are IMHO distracting and unfortunate. As far as I can tell the object-oriented concept of protocols came out of Smalltalk, where what is seen in later object-oriented languages as calls made between functions of different objects was modeled instead as messages passed between different objects. In that context it made sense to name "protocol" a collection of messages that certain types of objects could understand (see this 1981 article). But these were never actual communication protocols, and this article in its current state is IMHO confused and confusing when it associates the two different meanings of the term "protocol" everywhere, instead of just in a section discussing the history of the name (if that's even warranted).
This article is also confusing when it calls "protocol" a term rather than a concept. See my comment above about that.
Both the concept of messages and the concept of protocols introduced in Smalltalk are powerful. When later object-oriented languages came about, however, or when object-oriented features were added to other languages, these two concepts were not well known and some of these other languages used the existing and better-known concept of "interface" to implement that what had been previously known as protocols, even though that "interface" term already had a significantly different meaning. Now programmers who use those languages tend to use the term "interface" to refer to the concept of protocols, and either don't make a distinction between that concept and the more general concept of programming interfaces, or use qualifiers to make the distinction. In Java for example not only can the term "interface" be used to refer to both protocols in their original sense and programming interfaces in their original sense, but the corresponding keyword is used to implement these two different things! So many Java programmers never even see a distinction between the two concepts.
IMHO whether this article should be called "protocol" or "interface" depends on: 1) Which concept it should document ("protocol" in the original Smalltalk/Objective-C/Swift/Python/... sense of a collection of behaviors implemented by objects that have something in common even though they may be of different types or "interface" in the Java/C++/.. sense which is a combination of that "protocol" concept with the concept of the public face of an object independent of any of its implementation details); 2) How confusing it would be to have two different Wikipedia pages (Interfaces_(object-oriented_programming) and Interface_(computing)) that provide different definitions for the same term in the same general field; and 3) Given how precise the definition of the "protocol" historical concept has been, whether we should document here a more vague meaning of that concept, under a different names, simply because some programming languages (however popular they may be) chose to use as a keyword for the concept a term that had and still has a different meaning.
In general this shouldn't be a popularity contest. A change should be made only when justified by references, references which should not be popularity meters like web search query trends or results, nor the documentation of a particular vendor's language or software package, but instead published papers giving a good indicating of which terms are actually used in academia, industry, or elsewhere. We're entitled to our opinions but not to renaming articles solely based on them :-). IMHO and everything... TFJ76 (talk) 13:42, 11 November 2022 (UTC)[reply]
Your point about having two pages about the same term in the same field is valid, and I would even support deleting this article, leaving it as a section of Interface (computing) (a section which already exists but could possibly be expanded). Based on personal experience I think the term interface is used in the field (academia and industry) much more than protocol when referring to this, but I don't have the sources to back that up. WPscatter t/c 18:17, 11 November 2022 (UTC)[reply]
WP:COMMONNAME essentially is a popularity contest, and words change meaning over time. That a hypothetical 1970s-1980s Wikipedia would have used one word doesn't imply that's the clearest word to use now.
But I think there's validity in the rest of your points. What it comes down to for me is: are these two different words for the same thing, or two different things? I currently believe the former but I'm willing to be convinced otherwise. Either way, something needs reworking.
If they're essentially the same thing ± relatively minor language-specific differences, it seems clear to me that "interface" is the word people use for that thing now. I would, in this case, also support merging into Interface (computing) as Wpscatter suggests, and dropping the 'main article' link from there.
If there really is a substantially different thing called a protocol, this article should be rewritten to actually be about that, and not about interfaces or network protocols.
I suspect Concept (generic programming) also fits into this mess somewhere, but I haven't read it thoroughly enough to have a fully formed opinion on that yet. mi1yT·C 07:53, 12 November 2022 (UTC)[reply]
Wanting more Real Sources for this is a valid point, so here's a brief sampling of sources on whether these are different things.
  • Messages are usually designed in sets to define a uniform interface to objects that provide a facility. Such a set of related messages is called a protocol. [...] When a message protocol is designed for a class, it should be made general enough to allow alternative implementations.[1] This sounds like an interface to me.
  • A program for extracting protocols, or sets of message names, directly from the Smalltalk system is described.[2] Again, no suggestion that there's more to it than a list of possible messages. The same paper uses "interface" many times to describe the same concept.
  • A protocol has additional structure, which we discuss in section 4.3. However, the interface of an object is always determined by its protocol..[3] Section 4.3 is too long to quote in full, but seems to be saying that "interface" is either a class's or an instance's set of messages, and "protocol" is the combination of the two. This, frankly, reads like pointless pedantry to me, but I do have a bit of a bias toward thinking that :)
  • prevention of violations of object protocols, i.e., restrictions on temporal orderings of method calls on an object[4] Probably the strongest counterargument. This is clearly talking about protocols as an additional thing describing how to call methods and not just what they are.
  • Recently, a lot of occurrences of "protocol" refer to communication protocols, because session types caught on as a research topic. I don't consider these especially relevant.
Languages in common use today that use "protocol" (Clojure, Swift, Python) all use it in the "interface" sense (list of method signatures that implementing classes must have). Java is listed there, but I can find no sources for that so I'm going to remove it.
  1. ^ Stefik, Mark; Bobrow, Daniel G. (15 December 1985). "Object-Oriented Programming: Themes and Variations". AI Magazine. 6 (4): 40–40. doi:10.1609/aimag.v6i4.508.
  2. ^ Cook, William R. (31 October 1992). "Interfaces and specifications for the Smalltalk-80 collection classes". ACM SIGPLAN Notices. 27 (10): 1–15. doi:10.1145/141937.141938.
  3. ^ Bracha, Gilad; Griswold, David (1 October 1993). "Strongtalk: typechecking Smalltalk in a production environment". ACM SIGPLAN Notices. 28 (10): 215–230. doi:10.1145/167962.165893. ISSN 0362-1340.
  4. ^ Beckman, Nels E.; Kim, Duri; Aldrich, Jonathan (2011). "An Empirical Study of Object Protocols in the Wild". ECOOP 2011 – Object-Oriented Programming. Springer: 2–26. doi:10.1007/978-3-642-22655-7_2.

mi1yT·C 09:37, 12 November 2022 (UTC)[reply]

Conditional support with comment: This article could use a bit of cleanup, in all honesty. I am a bit biased myself (as I'm primarily a Java/C# developer), so I've personally only really encountered these things discussed as 'interfaces', not as 'protocols', but, taking a look at this article, I'm still not entirely sure what a 'protocol' is supposed to be. Yes, in the case of Python, it appears to be the Python name for an Interface, but then there's languages like Objective-C (having @protocol and @interface as distinct keywords) and Swift (apparently using 'protocol-oriented programming') which does make things a tad confusing.
Basically, upon reading this article, I'm not sure if the idea of a 'protocol' which this article is supposed to be about is 'the thing that I know as interfaces', or 'the process/theory of using things that I know as interfaces', or something else entirely. I'm assuming it's probably the former (ie that '"protocol" is a synonym for "interface"'), however, if protocols and interfaces are distinct concepts (ie that '"protocol" is the name for the process that "interfaces" (as I know them) are a component of'), then count this as an Oppose, a request for this to be made more clear in the article (and maybe add a section on how 'interfaces' relate to the whole idea of 'protocols' for the sake of everyone else who probably hasn't encountered the term 'protocol' used in whatever sense it's being used in within this article) 🔥HOTm̵̟͆e̷̜̓s̵̼̊s̸̜̃🔥 (talkedits) 05:30, 13 November 2022 (UTC)[reply]
Objective-C seems to use "interface" to mean a specific class's set of methods, and "protocol" to mean what Java/C# call interfaces.
Swift protocols seem to be interfaces with some extra features that don't really change the core concept. Protocol extensions sound a lot like C#'s extension methods; composition is just intersection types.
"Protocol-oriented" sounds like meaningless marketing buzzwords to me, but I haven't actually used it, and I've said the same about lots of other "*-oriented/driven" terms that most people seem to take seriously, so possible bias there.
Those seem to be the main two languages that actively use the term. (Python might in principle, but in practice, nobody in Python really talks about protocols to the extent more OO-focused languages do.)
(This is rapidly heading toward "no consensus because none of us can tell what the article is even about". That's a great sign.) mi1yT·C 07:35, 13 November 2022 (UTC)[reply]
This is rapidly heading toward "no consensus because none of us can tell what the article is even about".
well, yes.
Then again, I've just had a cunning plan that might bypass this problem entirely. Perhaps it could be worth repurposing the Interface (Java) article into a more generic 'Interface type' article, specifically about interfaces themselves, briefly discussing how different languages offer this sort of functionality (similar to Enumerated type, Function type, Abstract type, etc). That way, there will be an article explicitly about interface types, allowing this article to focus specifically on whatever a 'protocol' is supposed to be. 🔥HOTm̵̟͆e̷̜̓s̵̼̊s̸̜̃🔥 (talkedits) 12:16, 14 November 2022 (UTC)[reply]