Questions about interface related design considerations, such as programming to the interface.

learn more… | top users | synonyms (1)

12
votes
8answers
6k views

What is the point of an interface? [duplicate]

Possible Duplicate: When to use abstract classes instead of interfaces and extension methods in C#? What other reasons are there to write interfaces rather than abstract classes? This ...
6
votes
1answer
134 views

Private interfaces within a package

This is basically the same as Coding to interfaces, but played out in the real world of com when there are various engineering complexities such as immutability of published interfaces and ...
1
vote
2answers
2k views

What other reasons are there to write interfaces rather than abstract classes? [duplicate]

Possible Duplicate: When to use abstract classes instead of interfaces and extension methods in C#? When I read and looked at codes using Abstract classes, I was able to justify it because ...
10
votes
3answers
747 views

How do existential types differ from interfaces?

Given the existential type T = ∃X.{op₁:X, op₂:X→boolean} and this generic Java interface: interface T<X> { X op₁(); boolean op₂(X something); } What are the fundamental differences ...
3
votes
3answers
341 views

Naming conventions for the only envisioned implementation of an interface

If you decide "Program to An Interface" trumps YAGNI and decide to create a supertype where you don't envision anything other than one obvious implementation - is there a convention for naming the ...
5
votes
3answers
324 views

Should I provide synonyms in an API?

I'm designing a small library and there is a strong temptation to provide synonyms to some of the exported functions. var foldl = function(){ ... }; var reduce = foldl; //reduce is a synonym for ...
2
votes
5answers
605 views

Design Methodology for Developing Interoperable Systems?

A bit of background The company I work for has been creating database applications since around 1980 and, until relatively recently, most of these systems have been stand-alone "silo" systems. ...
1
vote
2answers
217 views

How is this “interface”-like structure/pattern called? [closed]

Let's assume we have an XmlDoc class that contains basic functionality for dealing with an XML data structure and saving/loading data to/from a file. Now we have several subclasses, A, B and C. They ...
8
votes
3answers
8k views

Difference between various Collection Generic Interfaces in C#

I have been playing around with C# for Windows and ASP.net MVC development for some time now. But I am still unclear on a few areas. I am trying to understand the basic difference between and ...
32
votes
6answers
4k views

Should interface names begin with an “I” prefix?

I have been reading "Clean Code" by Robert Martin to hopefully, become a better programmer. While none of it so far has been really ground breaking it has made me think differently about the way I ...
-5
votes
4answers
2k views

What is Interface in Java programming language? [duplicate]

Last week my lecturer was teaching us about interfaces in Java. However, I failed to understand her explanation that well. Does anyone have a good description, or explanation of Java interfaces, and ...
7
votes
4answers
3k views

Can I consider interface methods as abstract methods?

I was thinking about that, and I had some doubts. When I declare an interface, for example: public interface MyInterface { public void method1(); public void method2(); } Could these ...
9
votes
4answers
339 views

Are interfaces and method signatures copyright protected?

For example, is it copyright infringement if I write a class called Random with the exact same purpose and method signatures as Microsoft's .Net System.Random class? Does it make a difference what ...
1
vote
1answer
275 views

What's the best way to use a kinect with multiple software music synthesizers?

For the past few months I've been looking into developing a Kinect based multitouch interface for a variety of software music synthesizers. The overall strategy I've come up with is to create ...
5
votes
2answers
4k views

What is the proper way to implement the OnClickListener interface for many buttons

My Android Activity contains multiple buttons that all need an OnClickListener. I've seen lots of different ways of doing this such as:: Implementing the interface in activity class Creating a ...
2
votes
3answers
2k views

Why should I use interfaces if the implementation will mostly stay the same? [duplicate]

Possible Duplicate: Why are interfaces useful? In our company we have a service oriented architecture in our asp.net application. We use interfaces for every crap class. Its a huge ...
90
votes
19answers
40k views

Why are interfaces useful?

I have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, ...
7
votes
3answers
345 views

How do you find your way in deeply nested, interfacey code? [duplicate]

I know most people hate flat and long functions, and hate when code is not full of ISomethings. The problem is that I guess my mind works in different way, and I always have problems with that type ...
8
votes
11answers
748 views

Why do interfaces require methods over members?

...As this forces us to create getters and setters, which in practice are often totally extraneous? Is there any good language-design reason why interfaces in most (all?) languages do not allow member ...
28
votes
9answers
4k views

Are abstract classes / methods obsolete?

I used to create a lot of abstract classes / methods. Then I started using interfaces. Now I am not sure if interfaces aren't making abstract classes obsolete. You need a fully abstract class? ...
37
votes
11answers
3k views

Is it bad habit not using interfaces? [closed]

I use interfaces rarely and find them common in others code. Also I create sub and super classes (while creating my own classes) rarely in my code. Is it a bad thing? Would you suggest changing ...
11
votes
6answers
942 views

How to implement only a part of an interface

When developing in OOP, sometimes an interface / contract is given by a library that you cannot alter. Let's call this interface J. Now you have an object of class A that consumes objects that ...
16
votes
9answers
6k views

Default vs Impl when implementing interfaces in Java

After reading Should package names be singular or plural? it occurred to me that I've never seen a proper debate covering one of my pet peeves: naming implementations of interfaces. Let's assume ...
3
votes
4answers
3k views

What are good reasons to use explicit interface implementation for the sole purpose of hiding members?

During one of my studies into the intricacies of C#, I came across an interesting passage concerning explicit interface implementation. While this syntax is quite helpful when you need to resolve ...
4
votes
9answers
796 views

Does single inheritance limit what we can do with generalisation?

As a rule of thumb, generalisation is used only in specific circumstances. For example, when we can say that X is literally a subclass of Y. So, we can happily say that a Horse is a subclass of ...
29
votes
12answers
9k views

Why does PHP have interfaces?

I noticed that as of PHP5, interfaces have been added to the language. However, since PHP is so loosely typed, it seems that most of the benefits of using interfaces is lost. Why is this included in ...
0
votes
1answer
617 views

Building a table (DataGridView) while keeping decoupled from Model

I'll try to keep this simple. Small C# app, dialog based, one has a DataGridView. I've got an UpdateTable function in the form that accepts a DataSet and passes it to the DataGridView.DataSource. ...
16
votes
4answers
11k views

Model-View-Presenter implementation thoughts

I'm trying to get a good grasp of how to implement good decoupling between a UI and the model, but I'm having trouble figuring out exactly where to divide the lines. I've been looking at ...
9
votes
5answers
1k views

Modified Strategy Design Pattern

I've started looking into Design Patterns recently, and one thing I'm coding would suit the Strategy pattern perfectly, except for one small difference. Essentially, some (but not all) of my ...
2
votes
7answers
1k views

Architectural patterns for interaction beyond MVC? [closed]

We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment. What are some other architectural ...
0
votes
5answers
2k views

Why does the use of interface-based programming appear to be limited to behaviour?

I have been doing a little thinking about inheritance vs. realization vs. composition. I am not about to post the whole detail here. So I was wondering, when we are not talking about creating ...
17
votes
3answers
1k views

Would adding award points or game features to workplace software be viewed poorly amongst the programming community?

So one of my responsibilities at work is to build an internal tool that helps the workers enter in all their information. It's an enterprise application that is similar to a Windows forms database ...
41
votes
7answers
28k views

When to use abstract classes instead of interfaces with extension methods in C#?

"Abstract class" and "interface" are similar concepts, with interface being the more abstract of the two. One differentiating factor is that abstract classes provide method implementations for derived ...
5
votes
3answers
3k views

What can I use instead of Interfaces in Ruby (or any other dynamic language)?

My goal is to define contracts between classes. I like duck typing and all but I'd like also to define an interface between different layers of my application to clearly define which are the method ...
1
vote
11answers
250 views

Consistency of an object

I tend to keep my objects consistent during their lifetime. In some cases, setting up an object requires multiple calls to different routines. For example, a connection object may operate in this way: ...
5
votes
3answers
848 views

How do Text User Interfaces (TUI) work?

Hello I have recently been assigned to port and old cobol programm. I am used to GUI and it i cant understand how TUI work!! I searched a lot through google but could find something.... I knew that ...
7
votes
6answers
390 views

What core principles would you want in a library?

Theres talk about what syntax and feature you like in a programming language; i'll now ask what core principles or feature would you like in a library in your favorite (or any) language? An example ...