Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.

learn more… | top users | synonyms

10
votes
2answers
104 views

Functional interface hierarchy in Java 8

I just created the following code and am wondering whether it is logically correct (all other feedback is of course also welcome): ...
10
votes
1answer
82 views

DataLayer Interfaces Genericized

I have some concerns on my refactoring for the data layer in my current Project. Just for a small info, I am currently building a CRM as "training JEE application". But enough of talk, let's talk ...
7
votes
6answers
581 views

Fluent interface and polymorphism

EDIT: For further improvements see the related question: Variadic templates and pointers to member functions to achieve a named-parameters interface in C++ I would like to improve the interfaces of ...
7
votes
1answer
878 views

Interface using for decoupling

I am studying about how to use interface for decoupling. As I studied I wrote a program. I am pasting my code below. Does my program actually implemented decoupling ?. Is there any modification to ...
6
votes
2answers
892 views

Empty Interface usage - is this a code smell?

I've recently made a set of interfaces/classes to work with converting a spreadsheet into an object but I utilise an empty interface in my design: So first off I have my interface which defines what ...
6
votes
1answer
271 views

Variadic templates and pointers to member functions to achieve a named-parameters interface in C++

I studied a bit and packed all the suggestions that I received here: Fluent interface and polymorphism and I came up with this: ...
5
votes
1answer
144 views

How do I extract interfaces from existing similar classes?

I have about 11 singleton-esque classes divided over a dozen files: the first file is one that gathers all singleton definitions and makes them callable on a request scope: ...
5
votes
1answer
67 views

Interface for a tree node in Qt

I have the following C++ interface (in Qt) for a tree node, inspired somewhat by Valve's implementation of a culling octree: ...
5
votes
2answers
596 views

Generic Task Blocking Queue

A generic blocking queue has the following properties: It is thread-safe. It allows queuing and de-queuing of items of a certain type (T). If a de-queue operation is performed and the ...
5
votes
2answers
67 views

When should I actually derive from my interface?

Context: I am working on an XNA project, and since procedural generation is likely to be used, I wanted to eventually create a helper class to work with data to facilitate that. Design Goal: ...
4
votes
3answers
281 views
4
votes
1answer
32 views

Binary relation interface

I'm trying to design a binary relation interface in Java and then implement it, but I'm not sure if I'm doing it right. I'd really appreciate a little feedback just so I know if I'm way in the wrong ...
4
votes
1answer
90 views

Python model for a “snake”-like game

I wrote a python model for the game "snake" that I'm not really satisfied with. My intention was to separate the game logic from the drawing and input handling (which worked quite well) but I've got ...
4
votes
3answers
360 views

Is this interface too “god-like?”

I have an MVC framework I've written. I'm trying to abstract out ASP.Net specific bits as well as make it more testable. Previously, I relied on HttpContext.Current ...
3
votes
1answer
63 views

How to provide best integrity for interfaces in C#?

I am trying to apply Interface principles into my code, learn by practice method. I have a CRM system that has Notes, Payments, DairyEvents and anything else that needs to be bolt on over time. I ...
3
votes
1answer
102 views

Review of 2d Vector class

I'll keep this short. I've never actually done professional C++. I don't really know any of the 'best practices'. I'd like to get some review on a simple class that I've made. My Vector2d.h file: ...
3
votes
3answers
121 views

Test Driving Interface Design [closed]

I have been doing TDD since I have started my first job out of university (about 5 months ago), most of which is working with legacy code. I started a personal project today and thought I would TDD ...
3
votes
0answers
30 views

Many interfaces and lots of inheritance vs few interfaces and less inheritance?

I have a Visual Studio Solution which has a bunch of Projects in it. One of these projects is called "Services" and is basically the junction point between all remaining projects. When I built it ...
2
votes
4answers
232 views

Understanding Interface

...
2
votes
1answer
52 views

Backend interface VS hard contract

Here is an API for using a warehouse: ...
2
votes
1answer
56 views

Cleaning User Input

I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to ...
2
votes
2answers
1k views

Interface programming with Data Access Layer

I have several controls that are bound from database tables. Putting my OOP thinking cap on I figured since all of the controls will have a SqlCommand name and an ...
2
votes
1answer
341 views

Common interface but need to have different return types

I was suggested to move my question from Stack Overflow to here. I didn't know about CodeReview, so because it's my first post I would like to say "Hello". So now, let's come to the issue... I am ...
2
votes
2answers
18 views

User Authentication Bundle

I wrote a user authentication program(s) for an MVC application. Before you ask part of the project specs are I have to store user information in company databases on servers that aren't the web ...
2
votes
1answer
249 views

Have I implemented the command pattern correctly?

This is my command interface public interface IConverter { void convert(); } This is my Receiver class ...
2
votes
1answer
25 views

Loose coupling, accessing class properties

I'm trying to get a better understanding of decoupling methods. Right now, I have this method: ...
2
votes
0answers
116 views

jQuery plugin boilerplate jquib - critics please

Inspired by jqueryboilerplate.com I extended their boilerplate to fit my needs. Comming from the PHP development I wanted to have good starting point for writing jQuery plugins with a defined ...
1
vote
2answers
504 views

What design pattern to use on this case

I have this code that converts audio to different file formats. ...
1
vote
1answer
124 views

Proper implementation of generic repository

What can be done better in this code? I am sure it's not missing much. You can copy and paste the whole thing in LinqPad; it's all there. ...
1
vote
1answer
79 views

Call all methods in the interface [closed]

I have an interface and I need to call all methods in this interface: My interface design: ...
1
vote
1answer
133 views

Empty abstract class enforce structure

I've been looking into empty abstract classes and from what I have read, they are generally bad practice. I intend to use them as the foundation for a small search application that I am writing. I ...
1
vote
1answer
283 views

Can someone review my doubly linked list?

Here is the implementation with the interface below: ...
1
vote
0answers
134 views

Interfaces and Classes between Projects

My application's structure looks like this: Solution: MySolution Projects in MySolution: Host, Business, Server. References between the projects looks like this: Host <-- Business --> Server ...
1
vote
1answer
116 views

How to deal with interface inheritance and common properties? [closed]

I'm trying to design a generic caching system that takes keyed items and allows either read-only or read-write access to a cached version of it. The read-only backing interface is: ...
0
votes
2answers
66 views

Interface of an authorization subsystem [closed]

I need to just design the interface of an authorization subsystem. This is what I have so far. What else would you suggest or change in the interface? For example, HR can see everyone but not their ...
0
votes
2answers
903 views

Singleton interface in Java

I've created a singleton by means of an interface. I don't want to make a thing with getInstance() etc because I don't care about inheritance, and it's redundant ...
0
votes
1answer
374 views

Defining a Constructor In an Interface Java? [closed]

I have multiple different implementations of an object, which implement this custom interface I made called Board. ...
0
votes
2answers
55 views

the right way to write javascript client's method for channel subscribing

I am writing an open-source application for real-time messaging in web. In my application clients from browser can subscribe on channels. But every channel belongs to a certain namespace which ...
-1
votes
1answer
505 views

Log4Net Wrapper with some error potential [closed]

Some time ago, I found the following log4net wrapper here But I think it is errorprone (in case of threading, could there be deadlocks?) and the public interface seems to be too wide. What to do ...