interface

Which effect do interfaces have on execution speed in Delphi?

If I replace all object references in my Delphi program with interface references, and use objects which are inherited from TInterfacedObject, will the resulting application run with the same speed as before? Or does the reference counting add a significant execution overhead at run time? ...

Iphone interface builder

hey all my question about how the developers makes their interface the buttons, slider, segmented control and other is any program can make those thing ? and then import it to interface builder ? my brother is a graphic designer and he work a lot a 3d modeling he can make all those thing in 3ds max, maya or cinema 4D but how to tell the ...

How to make in Object Pascal "class of interface" (or "interface of interface") type

Hi! Look at this sample: //---------------------------------------------------------------------------- type ISomeInterface = interface procedure SomeMethod; end; // this is wrong, but illustrates that, what i need: TSomeClassWhichImplementsSomeInterface = class of ISomeInterface; var gHardCodedPointer: Pointer; // no m...

MOQ - how to mock an interface that needs to be cast to another interface?

what I want to do is construct a moq for I1 - which is fine ... however in the course of the method that I am testing that uses this mock I need to cast it to I2 in order to access some properties that are not on I1 Interface I1 { int AProperty{get;set;}} Interface I2 {int AnotherProperty{get;set;}} I then have some objects Class O...

Best practice for interface with a getter function that could return multiple types

I have several data manipulation widgets that all implement a custom IPropertyEditor interface. I would like to include a GetValue getter, but the return types could be String, Boolean or int, off the top of my head. In AS3, all of that inherits from Object, so I could have GetValue return an object, but I don't feel great about that app...

In Ruby, what is the equivalent to an interface in C#?

Hi, I'm currently trying to learn Ruby and I'm trying to understand more about what it offers in terms of encapsulation and contracts. In C# a contract can be defined using an interface. A class which implements the interface must fulfil the terms within the contract by providing an implementation for each method and property (and mayb...

casting an object to base interface

Hello, I have got a problem on casting an object to one of it's base interfaces living in another library. Here is the code for it: BaseSDK.dll public interface IPlugin { void Run(); } CustomPlugin.Definition.dll: public interface ICustomPlugin { void DoCustomStuff(); } CustomPlugin.dll (has reference to BaseSDK.dll and Cu...

Interface inheritance reversing class inheritance.

Hi Recently we have encountered the following situation. We had a class hierarchy, Base | Derived1 And we had a interface as interface I1 { void method1(Derived1& ob); void method2(Derived1& ob); void id(string ob); }; Now we have introduced another derived class to this. Base | -----...

Mac OS X Aqua interface for MS .NET?

Hi! Do you know any (free or commercial) libraries to make my Windows application look like Mac OS X Aqua app? Thank you! P.S. Do you know what unity3d.com used for their editor on Windows platform? ...

Interface inheritance: is extending properties possible?

I want to do this: interface IBase { string Property1 { get; } } interface IInherited : IBase { string Property1 { get; set; } } So that IInherited would have the inherited property Property1 with added functionality to allow set. Is that possible? What's the syntax? EDIT: please notice I put the word "inherited" in bold fa...

Lists and ICollections

Looking at the interface System.Collections.Generic.ICollection its definition requires that the inheriting member contains the property bool IsReadOnly { get; }. However I then took a look at the class System.Collections.Generic.List which inherits System.Collections.Generic.ICollection and this class does not contain a definition of ...

C# Collection using Generic types or Interface

Hi All, I have a set of classes (MyClass1, MyClass2, MyClass3) that implement an interface (IMyClass). I am interested in creating a method to fill and return a list (Collection.Generics.Lists<>) of objects that have common interface MyClassX (List<IMyClass>). But how? Each class has a constructor MyClassX which does something differe...

Interface implements a different interface, causing issues binding to Combobox

I am learning Fluent NHibernate and this issue arose from that project. I have a base Class and a base Interface: public abstract class Base : IBase { public virtual Guid Id { get; set; } public virtual bool IsValid() { return false; } } public interface IBase { Guid Id { get; set; } bool IsValid(); } ...

Should generic constraints be preferred to using interfaces as parameter types?

Consider this trivial function: public static bool IsPositive(IComparable<int> value) { return value.CompareTo(0) > 0; } Now, if I pass an int to this method, it gets boxed. Wouldn't it therefore be better to define the above method as follows? public static bool IsPositive<T>(T value) where T : IComparable<int> { return valu...

Linq to NHibernate does not return proper data

I have a class public class Item : IItem { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual bool IsActive { get; set; } } public interface IItem { Guid Id { get; set; } string Name { get; set; } bool IsActive { get; set; } } public class ItemMap : ClassMap<Item> { ...

Decyphering undocumented COM interfaces

Greetings all, I have a pointer to a COM object that implements an undocumented interface. I would really, really like to be able to use said interface. All I have is the IID though. Master software analyst Geoff Chappell has documented a host of these undocumented COM interfaces on his site; see IListView for example. Somehow he ev...

why we need interface in java?

In java to implement multiple inheritance we use interface.Is it the only use of interface?If yes what is the main use of interface in java?why we need interface in java? ...

Delphi plugin framework

Hello, I want to design Delphi plugin framework. There are three options: 1. DLL 2. BPL 3. COM interface Every option has some disadvantage. DLL - Promblem with MDI apllication, forms from plugin cannot be embeded to the host exe - mdi application. BPL - Every *.bpl plugin and *.exe host application must be compiled with the same versi...

Can we have member variables in Interface?

I read somewhere that interfaces can have member variables. Static final constants only, can use them without qualification in classes that implement the interface. On the other paw, these unqualified names pollute the namespace. You can use them and it is not obvious where they are coming from since the qualification i...

Do you have advices about how to wrap an internal library to deliver it to a client ?

In my company, we are using a cross-platform utility library offering a lot of services. This includes both cross-platform code (e.g. a thread class wrapping either Win32 or pthread API) or every company specific code (e.g. classes to handle proprietary communication protocol between our servers and our clients applications). We need t...