interface

WCF objects, multiple IList implementation and serialization errors

Problem: WCF contract objects cannot implement 2 types of lists (ie: List and List). Long-winded explanation: I'm building a WCF service on top of an existing core system, and I'm trying to work out the best way to implement some of my business objects. The core system utilizes interfaces for all business objects - Person management ...

c# - How to do MULTIPLE "mixins" correctly with Interfaces and/or Abstract Classes

I want to be able to define some objects and attach some "behaviors" to that object where the implementation is in the behavior not in the object. Rails-like: acts_as_taggable. As a concrete example, I want to say that Tasks can be Tagged. I don't want to have to code anything in Task about Tags beyond "enabling" the behavior via ... ...

Why do we use Interface? Is it only for Standardization?

Why do we use Interface? Is it only for Standardization? ...

Inheritance in Javascript

I am working on a simple problem to represent a few types that have a hierarchical structure. There is a data row that contains some data, and the data could vary from type type of row to another. A simple row might only have a title and date, while an extended row may contain a title, description, date and an image. I am not new to Java...

Can Fluent NHibernate's AutoMapper handle Interface types?

I typed this simplified example without the benefit of an IDE so forgive any syntax errors. When I try to automap this I get a FluentConfigurationException when I attempt to compile the mappings - "Association references unmapped class IEmployee." I imagine if I were to resolve this I'd get a similar error when it encounters the ...

Why can't a Visual C++ interface contain operators?

As per the MSDN doc on __interface, a Visual C++ interface "Cannot contain constructors, destructors, or operators." Why can't an interface contain an operator? Is there that much of a difference between a get method that returns a reference: SomeType& Get(WORD wIndex); and the overloaded indexer operator? SomeType& operator[](WORD ...

Why are interfaces not strongly typed?

I have the following code compiles without issue. Of course, I get an invalid cast exception when executing the Dim C As IDoThingsC = GetThing_C(). Am I missing something? Would you ever want to return an object that does not meet the interface requirement for a function return value? Public Class ClassA Public Sub DoThings_A() ...

Usability / UI Design / UX, etc. - documenting for a project

Hi all, I'm a software developer, and I'm going onto a project now that involves implementing a website using ASP.NET (3.5 / 2008, using the Web Client Software Factory). I've been tasked at creating a UI / UX Design Document for the project, however I don't really know where to start. I've been on one project in 3 years where there wa...

Interface Method Implementation and Passing ByRef with VB.Net

I have a C# interface defined as so: public interface IMenuSecurityService { void SetSecurityFlags(List<MenuItem> items); } I need to implement this interface in a VB.Net class. When I implement the SetSecurityFlags method with the items parameter passed ByVal, it compiles. Public Sub SetSecurityFlags(ByVal items As List(Of L1.C...

Use Rhino Mocks to create an in-memory database for use while developing code and user interface

Hi Everyone, I've been struggling with this all morning and I may be completely on the wrong track since Rhino Mocks was originally designed for Unit Testing. However, I have a couple of resusable backend components that handle Authentication and 'Blogging' like features of a website, each contains their own data access layer. While d...

How to design an extensible type infrastructure with dependencies among each other

My application is an editor for connecting "modules" (through module ports). Ports have port types. Each port type has it's associated comparator. Two types are compatible if their attributes satisfy rules implemented in the comparator. I want users to extend the application by implementing new port types and rules how to connect them (...

Why can't I use a String array with a method taking an Iterable as a parameter?

I'm trying to write my own "functional" little lib in Java. If I have this function : public static <T> List<T> filter(Iterable<T> source,BooleanTest predicate) { List<T> results = new ArrayList<T>(); for(T t : source) { if(predicate.ok(t)) results.add(t); } return results; } why can't I use it...

List of generic interfaces

If I have a generic interface with a couple of implementing classes such as: public interface IDataElement<T> { int DataElement { get; set; } T Value { get; set; } } public class IntegerDataElement : IDataElement<int> { public int DataElement { get; set; } public int Value { get; set; } } public class StringDataElement...

RMI binding same object twice but presenting different interfaces

Hey guys, I have an interesting one for you here! I have one object, called Server, that implements two RMI interfaces, CSCP and ISCP. I need my Clients to be able to communicate on the RMI CSCP interface, but know nothing of the ISCP interface, and I need other servers to communicate with it on the ISCP interface but know nothing of th...

interface issue

Possible Duplicates: IF structure issue Logic problem while setting conditions I have the following code: foreach (DataModelObject dmo in allObjects) { if (string.Compare(dmo.Name, hostName, true) == 0) { if (dmo is IResourcePolicy) { IResourcePolicy irp = (IResourcePolicy)dmo; ...

In C#, can a class inherit from another class and an interface?

I want to know if a class can inherit from a class and and interface. The example code below doesn't work but I think it conveys what I want to do. Does anyone have any recommendations??? The reason that I want to do this is because at my company we make USB, serial, Ethernet, etc device. I am trying to develop a generic component/inte...

Interfaces, Static Inner Classes and Best Practices

So, this is a question of coding style more or less. I'm using Bean Validation here but the idea is the same for any interface that has simple implementations that aren't likely to get changed all that often. @Target( { METHOD, FIELD, ANNOTATION_TYPE }) @Retention(RUNTIME) @Constraint(validatedBy = PhoneNumber.PhoneNumberValidator.clas...

Interfaces or Attributes for Tagging Classes?

I have a couple of classes that I wish to tag with a particular attribute. I have two approaches in mind. One involves using an Attribute-extending class. The other uses an empty interface: Attributes public class FoodAttribute : Attribute { } [Food] public class Pizza { /* ... */ } [Food] public class Pancake { /* ... */ } if (obj....

Is it possible to troubleshoot C# COM Interface Implementations?

I have a C# implementation of a C++ COM Interface. I have ported the IDL (Interface) as accurately as I can. When the C++ app instantiates my object it successfully calls one of the methods. It then tries to call another of the methods but nothing happens. The second call's execution path never makes it to the C# side. I don't have ac...

Help getting the 'Windows Input Simulator' C# interface working

This looks perfect for what I'm trying to do. I need to stop mucking around with SendInput() and let someone else do it for me! http://inputsimulator.codeplex.com/ The problem is there's no documentation for getting the code working as simply as it does on the home page there. Can someone help me with the 'other code' I need to have in...