interface

What's the behavior when you re-specify an interface already implemented by a base class

Given the following code: public interface IExample { ... } public abstract class BaseExample: IExample { ... } public class ExampleA : BaseExample { ... } public class ExampleB : BaseExample, IExample { ... } Are there any benefits or drawbacks in writing code like ExampleB? My guess is that re-specifying IExample in the derived cl...

Alternatives to static methods on interfaces for enforcing consistency

In Java, I'd like to be able to define marker interfaces, that forced implementations to provide static methods. For example, for simple text-serialization/deserialization I'd like to be able to define an interface that looked something like this: public interface TextTransformable<T>{ public static T fromText(String text); public...

Can some one explain the exact use of interfaces in C#

Can some one explain the exact use of interfaces in C# ? ...

How to handle JPA annotations for a pointer to a generic interface

I have a generic class that is also a mapped super class that has a private field that holds a pointer to another object of the same type: @MappedSuperclass public abstract class MyClass<T extends MyIfc<T>> implements MyIfc<T> { @OneToOne() @JoinColumn(name = "previous", nullable = true) private T previo...

Xcode / Interface Builder - better workflow from designer to coder?

Were dealing with some pretty custom UI elements while building our OSX / Cocoa and iPhone / IPad apps. I was wondering if anyone has good recommendations or tricks for getting a better workflow between UI designers and coders while using Xcode / Interface Builder? It seems that many things require programmatic settings with UI editing...

How to run own python script in Trac

Hi All, I want to customize the project page (trac/templates/index.html). I want to use a table to show more project-specific information. For instance the admin list of each project, the build status of each project. These information are stored in trac's database. I am afraid that the default template engine is not able to give me ...

Is Entity Framework more mockable than Linq2Sql?

I've found that Linq2Sql doesn't (Rhino) mock well, as the interfaces I need aren't there. Does EF generate code that's more mockable? NOTE: I'm not mocking, yet, without interfaces, the next reader of this question may not have my bias. EDIT: VS2008 / 3.5 for now. ...

Bind WCF webservice to specific network interface / IP

On a machine with multiple network cards I need to bind a WCF webservice to a specific network interface. It seems that the default is to bind on all network interfaces. The machine has two network adapters with the IPs 192.168.0.10 and 192.168.0.11. I have an Apache running that binds on 192.168.0.10:80 and need to run the webservice o...

Design issue when having classes implement different interfaces to restrict client actions

Let's say I'm defining a game class that implements two different views: interface IPlayerView { void play(); } interface IDealerView { void deal(); } The view that a game sees when playing the game, and a view that the dealer sees when dealing the game (this is, a player can't make dealer actions and a dealer can't make play...

WordNet Java Interface

Hi all I need to use WordNet with Java. Can anyone point me to some useful resources? Thanks in advance ...

Use a UITextVIew

Hello, I wanted to post some text in a UITextVIew. I wanted the user inserisse. As messages tomore be inserted into a queue to another as in a chat. How can I do? Thanks ...

Delphi: How to assign Click event to object's method?

i have a menu item, and i'm trying to assign its OnClick event handler: miFrobGizmo.OnClick := {something}; The OnClick event handler property, like almost every other event handler, is defined as a TNotifyEvent method type: property OnClick: TNotifyEvent where TNotifyEvent is: TNotifyEvent = procedure(Sender: TObject) of object;...

Delphi: How to call a method when i click a control?

i have a method: procedure Frob(Sender: TObject); that i want to call when i click a menu item. The method comes to me though an interface: animal: IAnimal; IAnimal = interface procedure Frob(Sender: TObject); end; The question revolves around what to assign to the OnClick event handler of a menu item (i.e. control): var a...

LINQ-to-SQL class doesn't implement INotifyPropertyChanging & INotifyPropertyChanged if pulling from local database

I modified my data source in my LINQ-to-SQL class (by the old delete and drag back in method), and was surprised to see the INotifyPropertyChanging & INotifyPropertyChanged interfaces no longer implemented in the generated classes (MyDb.designer.cs). The methods for the individual fields went from looking like this... [Column(Storage="...

Class inheriting from several Interfaces having same method signature

Say, I have three interfaces: public interface I1 { void XYZ(); } public interface I2 { void XYZ(); } public interface I3 { void XYZ(); } A class inheriting from these three interfaces: class ABC: I1,I2, I3 { // method definitions } Questions: If I implement like this: class ABC: I1,I2, I3 { public voi...

A question about entities, roles and interfaces in Entity Framework 4.

Hi, I am an experienced .NET developer but new to EF - so please bear with me. I will use an example of a college application to illustrate my problem. I have these user roles: Lecturer, Student, Administrator. In my code I envisage working with these entities as distinct classes so e.g. a Lecturer teaches a collection of Students. An...

How do I call functions inside C++ DLL from Lua?

I have a DLL written in C++ that is legacy code and cannot modify the source code. I want to be able to call some of the functions inside of the DLL from Lua. For example, I'd like to do something like this: -- My Lua File include(myCppDll.dll) function callCppFunctionFromDll() local result = myCppFunctionFromDll(arg1, arg2) ...

Improve this generic abstract class

I have the following abstract class design, I was wondering if anyone can suggest any improvements in terms of stronger enforcement of our requirements or simplifying implementing of the ControllerBase. //Dependency Provider base public abstract class ControllerBase<TContract, TType> where TType : TContract, class { public static TC...

COM Dual Interfaces

A dual interface in COM is one that is able to be accessed via a DispInterface or via VTable methods. Now can someone tell me what is exactly what the difference is between the two methods? I thought that a VTable is a virtual table which holds the pointers to the different functions when implementing a class hierarchy which has virtua...

Any way to avoid creating a huge C# COM interface wrapper when only a few methods needed?

Greetings all, I’m working on a C# program that requires being able to get the index of the hot item in Windows 7 Explorer’s new ItemsView control. Fortunately, Microsoft has provided a way to do this through UI Automation, by querying custom properties of the control. Unfortunately, the System.Windows.Automation namespace inexplicabl...