interface

How to implement a custom COM interface in Java

I need to pull some data from java into C#. I am already exposing my C# classes via COM. So I thought a good way to pull data from java would be to expose IReadStream from C# and implement IReadStream in java. I can then send an instance of the implementation as a parameter to C# so that I can call IReadStream.Read in C#. How do I imple...

Interface Insanity

I'm drinking the coolade and loving it - interfaces, IoC, DI, TDD, etc. etc. Working out pretty well. But I'm finding I have to fight a tendency to make everything an interface! I have a factory which is an interface. Its methods return objects which could be interfaces (might make testing easier). Those objects are DI'ed interfaces to t...

java interface design: how to handle stateful processing

I'm having trouble designing a good architecture for a particular portion of my application, especially where maintaining state is involved. I have a group of parsing operations: My class Reader reads in a block of data into a buffer and handles the overall control flow. My class Parser takes the block of data in the buffer and a Parse...

How do you initialise a const array of TGUID from Interface type data, in Delphi?

I want to initialise an array like this - Const MyArray : Array[0..0] Of TGUID = (IInterface); But it results in - [DCC Error] Test.pas(10): E2010 Incompatible types: 'TGUID' and 'string' So to see what would happen I tried this - Const MyArray : Array[0..0] Of String = (IInterface); Which results in this! [DCC Error] Test.pas(...

Passing Interface's method as parameter

Hi, is it possible to pass inetrface's method as parameters? I'm trying something like this: interface type TMoveProc = procedure of object; // also tested with TMoveProc = procedure; // procedure of interface is not working ;) ISomeInterface = interface procedure Pred; procedure Next; end; TSomeObject = class(TO...

Append new JavaDoc to existing from super method

I have generated an Interface which is very well documented. Every method does have his own JavaDoc. The clases which implement this Interface can have little differents in their logic. How can i add JavaDoc to the existing JavaDoc from the super class. The key word /** * {@inheritDoc} */ only set the javaDoc of the super class to...

Interfaces question

I'm trying to understand the -why- of this ... and I'm really struggling to grasp the concept of what I'm telling the compiler to do when I use an IInterface syntax. Can anyone explain it in a "this is what's going on" way? Anyway ... my main question is.... What is the difference between public IEnumerable<string> MyMethod() {...} ...

C# interfaces

What's the difference between Explicitly implement the interface and Implement the interface. When you derive a class from an interface, intellisense suggest you to do both. But, what's the difference? ...

Need Information on what 'interface' actually is in ASP.NET...

I am having a 'learning' day and am delving into an ASP.NET solution to try and learn more advanced techniques for building apps (I'm still in novice stage so please can you answer as if I am stupid :)... lol). And I have a couple of questions... 1.) Looking through the code I see this method public interface Somthing() I have never...

What is an interface that specifies an enumerable Windows control?

I have a method that validates a combo box control like so: Public Function ValidateComboBox(ByVal objMessageMode As Errors.MessageMode, ByVal cboInput As ComboBox) As Boolean Dim blnValidated As Boolean 'no value--invalidate' If cboInput.SelectedValue Is Nothing Then Errors.InvalidateField(cboInput, Errors.errFiel...

Why do dynamic languages like Ruby and Python not have the concept of interfaces like in Java or C# ?

To my surprise as I am developing more interest towards dynamic languages like Ruby and Python. The claim is that they are 100% object oriented but as I read on several basic concepts like interfaces, method overloading, operator overloading are missing. Is it somehow in-built under the cover or do these languages just not need it? If t...

Should you create an interface when there (currently) is only going to be one class that implements it?

Should you always create an interface if there's a possibility that there might be something else that could use it, or wait until there's an actual need for it then refactor to use an interface? Programming to an interface generally seems like sound advice, but then there's YAGNI... I guess maybe it depends on the situation. Right no...

Multiple interfaces from a single WCF service?

Can a single WCF service offer multiple interfaces, and if so how would you express this in app.config? I mean one services offering several Interfaces on one endpoint. ...

Internal and external interfaces and collections

What would be the best way to implement the following? I have a collection of objects that implement an interface, internally I want to be able to expose set and get on the properties and externally only get. Here's an example of the sort of thing I want... That does't compile. public interface ITable { string Name { get; } } inte...

Best Way of Having End User Specify Sort Order in Rails

I am looking for a suggestion on the best way of having an end user from a Rails application's view files set the sort order of a result set returned by a model's "find" method. In other words I would like a user to be able to choose their sort order from a selection list. Initially, I thought I could just put the string that I would p...

How to structure this interface/inheritance

I have a File class that has an Open() method. I have a subclass of File called TextFile that implements an IReadableFile interface, which requires the implementation of a Read() method. If I declare a variable myFile as IReadableFile, I can't call the Open() method on it. I want to be able to exercise the functionality of TextFil...

interface question

I have object called Foo. Right now it implements IFoo which has a lot of properties on it. I have one class that only depends on a few of those properties so i create IMeasurableFoo (which just has a few properties) to avoid duplicate code, i now have IFoo : IMeasurableFoo as i moved the properties into IMeasurableFoo but this feel...

RMI interface design principles

Im currently working on an RMI client that will talk to an RMI server (developed by a different division of the company I work for). The other team own the interface, but IMO it's overly complex, with many different types being passed backwards and forwards, as well as an unnecessarily (IMO) complex exception hierarchy. I've expressed ...

In a Java interface, how can I *not* use one particular method inherited from a parent interface?

I have a hierarchy of three interfaces, grandparent, parent and child. Parent and child have a method "add", which requires different input parameters in the child. While it's no problem to add the required signature in the child, the inherited method will be pointless, so is there a way to not have it in there at all? The other methods ...

DDD: What are good reasons for you to loosely-couple Entities?

Back in December, there was this post that was answered with "it is ok to use concret types [for simple object]". But I keep seeing more and more simple entities with interfaces in sample projects, and even the very large Enterprise application I just took control over (counting 89 interfaces and going). Is it that people are not picki...