interface

Javascript: Change scrollable element handle size in scrollbar

Is it possible to programatically access a Div's scrollbar handle and change its size? --Edit: Is there a mootools plugin for something like this? I'm trying to implement a lazy pagination mechanism, where a div's content will be updated onscroll, but I'd like the handle on the scrollbar to show the final size. Meaning, if there will...

About interfaces.

Possible Duplicate: Interfaces: Why cant I seem to grasp them? What is the purpose of interfaces in C#? How would they enable extendable,modular design in c#,Java? As far as my experience with the interfaces is concerned ,we used in a gridview scenario where columns values are brought from disparate objects. (e.g: List<IPub...

Why seems any kind of abstraction to be solved with interfaces instead of abstract classes?

Heyho, There´s a question in my mind for some time now, which hopefully can be cleared quickly by some of you: I am a big fan of MVC, ASP.Net Mvc in my case. What I have noticed is the hype about interfaces. Every video, tutorial and book seems to solve any kind of abstraction with interfaces. I have adapted these patterns, understoo...

Java interfaces directory structure?

Should interfaces in Java reside in their own directory? Or should both the interface and its implementation be placed in the same directory (package)? Thanks. ...

C#: enforceable way of signifying a method is there as part of interface

Is there a way in C# to mark a method as being part of a class to satisfy an interface that the class implements? I find myself wondering sometimes when digging in a class's code why some methods are there but then, when I try to remove one since it isn't in use, I see it's necessary in order for the class to implement some interface. ...

Interface in C#.

I am new to OOP and have some questions. Why can't methods declared in an interface have modifiers(public,private etc). In this code: class Program { static void Main(string[] args) { X ob = new Y(); ob.add(4, 5); Z ob1 = new Y(); ob1.mull(2, 3); Console.Read(); } } public interf...

Generic interfaces

Here is my code public interface ITranslator<E, R> { E ToEntity<T>(R record); } class Gens : ITranslator<string, int> { #region ITranslator<string,int> Members public string ToEntity<MyOtherClass>(int record) { return record.ToString(); } #endregion } When I compile this, I get an error Type p...

Why does Haskell stop short of inferring the datatype's typeclasses in the function signatures?

Firstly, this question isn't 100% specific to Haskell, feel free to comment on the general design of typeclasses, interfaces and types. I'm reading LYAH - creating types and typeclasses The following is the passage that I'm looking for more information on: Data (Ord k) => Map k v = ... However, it's a very strong convention in...

Is aspect oriented programming useful for providing implementations for interface based programming?

I was just curious about the subject. I have never used aspect oriented programming (intentionally), and I have only a small amount of knowledge about it. Here's my question (using logging as the typical use-case): If i have an existing interface based paradigm for example consider the pseudo-code class MyClass implements Loggable { ...

Creating Mock object of Interface with type-hint in method fails on PHPUnit

I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array $params); } Then I try to make a Mock object of this interface with PHPUnit 3.4, but I get the following error: Fatal error: Declaration of Mock_Action_b389c0b1::execute() must be compatible with that of Action::e...

C# syntax: Placing the interface's name in the implementation's declaration

I came across some interesting C# syntax that I'm not familiar with in the source code for the Composite Application Library for WPF's DelegateCommand<T> class. There are some method declarations which are prefixed with the ICommand interface name, and they do not have accessibility modifiers specified. For example: bool ICommand.CanEx...

COM - How to get the properties of an interface within the type library the interface is defined

How to get the properties of an interface within the type library the interface is defined, Keeps returning HRESULT but would like it to return the actual value of the property. EDIT: IDL: interface IMyClassInterface : IDispatch { [propget, id(1), helpstring("Gets user Type")] HRESULT getUserDefineTypeVal([out,retval] UserDefineEnu...

Why do interface implementations based on TComponent leak memory?

This Delphi code will show a memory leak for an instance of TMyImplementation: program LeakTest; uses Classes; type MyInterface = interface end; TMyImplementation = class(TComponent, MyInterface) end; TMyContainer = class(TObject) private FInt: MyInterface; public property Impl: MyInterface read FInt write FI...

Find out what classes implement an interface in .NET-documentation

This might be a bit silly, but where can I find a reference (not code) that tells me, what classes (in the .NET-Framework) implement an interface? Is this even available? I am thinking of the list one gets in the Java-API-documentation unter "All Known Implementing Classes" (like here for example: http://java.sun.com/j2se/1.5.0/docs/api...

Java Pass Method as Parameter

I am looking for a way to pass a parameter by reference. I understand that Java does not pass methods as parameters, however, I would like to get an alternative. I've been told interfaces are the alternative to passing methods as parameters but I don't understand how an interface can act as a method by reference. If I understand correc...

Java RMI - UnicastRemoteObject: what is the difference between exportUnicastRemoteObject() and extend UnicastRemoteObject()?

hi there! i'm preparing for an exam and I'm having a question that I hope someone here could answer me. Its about RMI and remote objects. I wonder why there is so much difference between these two implementations. one is extending the UnicastRemoteObject whereas the other is exporting the object as an UnicastRemoteObject. I don't really ...

Why isn't there a "set" interface in the .NET framework?

I'm thinking specifically about the generic class HashSet<T>. It implements several interfaces, but none exposes the correct semantics of a set. Specifically, none supports an Add method returning bool. (ICollection<T> supports void Add, which can be used in a pinch.) Also unsupported by these interfaces are common set operations like un...

Pure base class needs to be exported from DLL?

I have two DLLs a.dll and b.dll and in each one I have one class AClass and BClass. I would like to have both AClass and BClass inherit and implement the same interface AbsBase which is a pure abstract class. In each class I set up the #defines for __declspec(dllimport) and __declspect(dllexport). When I'm trying to compile I get this: ...

C# events in interfaces - confusion from a vb.net programer

hi, I'm having some real confusion about events in c#... if I have this code in an interface: Event OnBeforeSaving(ByVal Sender As TEntity, ByVal EventArgs As CancelEventArgs) How should it be in c#? When I run it through a converter it gives me this event OnBeforeSavingEventHandler OnBeforeSaving; delegate void OnBeforeSavingEventHa...

Viable selectbox alternatives to replace huge lists of items?

I'm wondering if there are any viable interface alternatives to using select boxes where there exists very large lists of data (1000+). For example, in my application, I have a form that shows the details for a single inventory item (it's a pretty basic inventory management application). When an inventory is shipped out, warehouse staff...