interface

why interface doesn't support static method?

Possible Duplicate: Why cant I declare static methods in an interface? Inside the interface body we aren't able to declare or define any static method. What is the reason? Can any one answer for this question? ...

C#: Why return a collection interface rather than a concrete type?

I've noticed in other people's code that methods returning generic collections will almost always return an interface (e.g. IEnumerable or IList) rather than a concrete implementation. I have two related questions. Firstly, why (if at all) is it considered better to return an interface? Secondly, is there a collection interface that inc...

.NET TypeBuilder - VerificationException: Operation could destabilize the runtime.

I need to create a type at runtime using the TypeBuilder. This type should implement a specific interface so that it is possible to treat instances of this dynamic type uniformly at the compile time. The interface should return an array of objects filled with values of specific fields in that type. Interface that is supposed to be imp...

Expose a object via Ria Services that implements an interface

Hi, A question about using interfaces on presentationModels with RIA services. It is possible to expose a object via Ria Services that implements an interface? The interface: public interface TestInterface { public int ID {get;set;} } We have a presentationModel : public class TestPresentationModel : TestInterface { [Key]...

Is there ever a reason to hide inherited members in an interface?

I understand that a class which inherits from another class may hide a property by using the new keyword. This, however, is hiding a specific implementation of the property, so I can see how it could be used. Is there any practical reason to hide members in interfaces which implement other interfaces? For example consider the example be...

c++ interface question

Hi, I have Package A (Namespace A), which has header file say internalItems.hpp, contains a class with enumeration of items to be created and methods to get and set item type. Now this class has to be made available in common package (Package Common with Namespace COMMON) so that other package (let says Package EndUser with Namespace ...

A little vb.net interface explaination....

Can anyone explain the (of Out T) component to this interface? I'm familar enough with how interfaces work. I also understand that T refers to a type... Whats going on with the Out portion. Public Interface IPageOfItems(Of Out T) Inherits IEnumerable(Of T) Property PageNumber() As Integer Property PageSize() As Integer ...

How do I name an interface when the base word starts with an I?

I want to create an interface for "Items". Typicaly I would name an interface by adding and "I" prefix to a base word. But in this case my base word already starts with an I. Here are a couple ideas I've had IItem: Two I's Iitem : Vary the case ItemInterface: Skip the I prefix and write out Interface What looks the best? Has anyone e...

Is a php interface redundant for apps build by a single developer ?

My question is : in PHP are interfaces really useful for developers that build website applications on their own ? Isn't an abstract class providing all the things an interface provides ? If an interface is just a "contract" isn't the developer aware of the things the class should implement ? The only single benefit I can think of is ...

implementing a new interface without creating a derived type

Hello, I have a several C# classes called ShapeA, ShapeB, ShapeC, etc. and collection class called ShapeCollection. they all inherit from an abstract class called Geometry. All of these classes arrive from a 3rd party assembly, so I can't change them. I want too add a new method to all of these Shape classes, let's call it Paint(), and...

php Singleton pattern with Abstract class and Interface

I am developing a framework. And I have confronted with some difficulties. For Database I have created Abstract class, Interface and some Adapters for different SCDB. For example, Mysqli adapter has the constructor, which call the constructor of parent with settings array as parameter. Mysqli class uses the next scheme: class Hybrid_Db_...

Generic method returning generic interface in Delphi 2010

Given the code below, wich is a very trimmed down version of the actual code, I get the following error: [DCC Error] Unit3.pas(31): E2010 Incompatible types: 'IXList<Unit3.TXList<T>.FindAll.S>' and 'TXList<Unit3.TXList<T>.FindAll.S>' In the FindAll<S> function. I can't really see why since there is no problem with the previous ver...

what's the difference between abstract and interface in php?

Possible Duplicate: PHP: What is the difference between an interface and abstract class? hi guys.. As far as I understand, a clase implements or extends abstract or interface class has to use the default methods. I know we can use implement keyword to use multiple interfaces, but we only can extend 1 abstract. Can anyone expl...

How to properly implement IHydratable interface in DNN?

After upgrading to DNN 5.5.0 we had to implement IHydratable on all of our business objects. This idea seemed like a good way to go at first, but after playing with IHydratable I'm not so sure any more. There are two possibilities: I'm doing it wrong IHydratable forces you to use select * construct an all your queries The business...

Objective C - How can I create an interface class?

I need to be able to create an interface like you create in C# to enforce a group of classes to implement certain methods. Is this possible in objective c? ...

Creating read-only versions of classes in a complex object structure

In my current project I need to be able to have both editable and read-only versions of classes. So that when the classes are displayed in a List or PropertGrid the user is not able to edit objects they should not be allowed to. To do this I'm following the design pattern shown in the diagram below. I start with a read-only interface (I...

Moq : How to mock a class which is not visible?

I've the following simplified code which describes my problem: public interface IMyUser { int Id { get; set; } string Name { get; set; } } Which is used in the dataccess layer like this: public interface IData { T GetUserById<T>(int id) where T : IMyUser, new(); } The userlogic class is defined as follows: public class...

What is the major difference between abstract class and interface ?

In context of recent trends in interviews i have noticed that this question arises every time. But when one answers the general definition then the interviewer says everyone knows it... tell something different. Further scenarios are asked where which one will be used and be beneficial and why So kindly share any new insight into this t...

Objective-C TableView Select Item Troubles...

Hello! I'm having trouble having my app respond when an Item is selected in the table view. I'm running everything from my app delegate (the table functions that is like dataSource and TitleForHeaderAtSection etc) which are all being called fine. However it is not calling my selection method when I tap on a item in the list. I even put ...

Java Basics - Where are the implementations taking place?

For instance, a method returns an object of type List. public List<Foo> bojangles () ... Some piece of code calls the method FooBar.bojangles.iterator(); I'm new to Java, but from what I can tell.. List is an interface, so the iterator method has to be implemented somewhere else. When digging for the source code for Java.Util and tha...