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...
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# ?
...
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...
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...
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 ...
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.
...
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...
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...
Hi all
I need to use WordNet with Java. Can anyone point me to some useful resources?
Thanks in advance
...
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
...
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;...
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...
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="...
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...
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...
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)
...
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...
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...
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...