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

0
votes
0answers
29 views

Updated version of app which does CRUD on a database table

A while ago I created my first Java application. I tried to follow the MVC pattern. I posted my code for review and with the answers I got I did more research and rewrote my code. I gave every ...
6
votes
5answers
668 views

An ordered set in C#

I need a generic data structure that ensures that its elements are unique. C# has HashSet<T>, great! As it turns out, the elements have to stay in the order ...
0
votes
1answer
22 views

Document (PDF, TXT, DOCX) to text classes

I wrote some classes to convert some documents (PDF, DOC, DOCX and TXT) to only text so that it can be stored in a search engine. Here's how I use those classes : ...
3
votes
1answer
37 views

Overloaded applyRestrictionsToCriteria(…) methods

We want to refactor two methods that are exactly the same, except for one difference: one takes an org.hibernate.Criteria and the other ...
0
votes
2answers
69 views

Have a class that holds all the interfaces [closed]

I seriously didn't know how to write this in Google, there must be an answer lying around. Here it goes: I'm using Ninject (IoC) and ASP.NET MVC 5. I have a business layer with a couple of classes. ...
0
votes
2answers
83 views
0
votes
4answers
62 views

iOS SDK object to represent a place

I am building an iOS SDK to be consumed by apps. I am building an object that represents a physical place. The interface looks like so: ...
2
votes
2answers
123 views

Strategy pattern using an abstract class and an interface

I have implemented some sort of the strategy pattern using an abstract class and an interface: ...
1
vote
2answers
117 views

Derived methods with Poker classes

I have an interface with two functions. This interface is being inherited by an abstract class which implements just one of those functions. The other one is left to be implemented by the derived ...
2
votes
0answers
35 views

Interface modelling for a journaling program in Java

My program's Journal consists of unique Pages identified by their Day. Within those pages ...
1
vote
2answers
84 views

Delphi 2009 interface

I have this code and at the end of it, FastMM shows that there were memory leaks with all the objects of TSinc: ...
0
votes
1answer
45 views

ViewModel class in Typescript

I am trying to refactor a ViewModel class because it has two methods that are really similar called updateRegions and ...
1
vote
0answers
35 views

A generic interface for nearest-neighbor data structures

I have written the following interface to represent data structures such as VP trees that perform nearest-neighbor searches. ...
3
votes
1answer
97 views

Somewhat less semi-primitive IRC bot - follow-up

As of now, instead of the previous 4 or 5 out of 10 (relative to my C# programming skill), I'd say I'm a solid 6, and some of that is thanks to the advice I got from the last revision. I realize the ...
5
votes
1answer
58 views

Abstract Interface for managing Init/Shutdown

In a small game project I'm using 'Init' and 'Shutdown' functions on Systems/Managers/Components to make resetting them easier without having to call the constructor/destructor. For example when ...
12
votes
1answer
108 views

To read a book thou should have it bought, to buy a book thou should have it found! (Search Abstraction)

I started a hobby project to find the books that I read (paperbacks) so that I can keep track of them (reading start date, finish date, number of pages, etc..) The first challenge was to find the ...
2
votes
4answers
222 views

Making a better Engineer

I have an Engineer which doesn't look very good. How can I make him better organized? What about good practices? Interface: ...
6
votes
2answers
191 views

Some sort of console “notepad”

This is notepad that works with list of files (pages w/e) that can be edited (list). You can access each file separately and edit/view it too (rewrite, append, read). Here's my implementation of it. I ...
0
votes
1answer
61 views

Wrapping packet information [closed]

I am developing a network application and therefor need to specify the packets I want to send. I have a basic interfaces class and one for the packets that implement them. ...
4
votes
1answer
548 views

BMR (Basal Metabolic Rate) Calculator

Been working on a BMR calculator on and off for a while now. Created an interface and been over different ways to store user input, different ways to calculate BMR/TDEE etc. I created another class ...
3
votes
1answer
96 views

Simple Vector2 structures (and interface)

I built a couple Vector2 structures (Vector2 and Vector2F) for use with a particular project,...
1
vote
2answers
37 views

Cameras and ITrackableObjects

The purpose of these two classes (and hence why I am including them together) is to allow you to create a Camera, that indicates a "render zone", and track an ...
2
votes
2answers
192 views

DataStream interface for reading and writing data

I am writing a C++ library which will interact on files, memory buffers and remote files accessible with the HTTP protocol. To handle that, I've decided to create some classes that will use the ...
1
vote
1answer
44 views

Interfaces & Factory for generic container supporting PeekMax, PeekMin, Sum, and PeekNextToMax

This is a partial update of this question. An implementation of these interfaces is in this question. To summarize, the class is a generic container similar to MaxHeap, but only needs to support the ...
7
votes
3answers
164 views

Implementing Dynamic Network Message Handling (Part II)

This is an iterative review request of this other question I posted. As a follow up to that previous question, I changed the pattern completely and I went to an events-based approach, which might be ...
12
votes
2answers
193 views

Implementing Dynamic Network Message Handling

I'm trying to handle network messages in a dynamic, and effective way, though I feel I've overthought it again. As of now, I have a very structured approach, but it feels as if it's a lot of overhead ...
1
vote
1answer
56 views

Interface for fixed-size container supporting max, min, sum

I had posted this previously as part of Generic container similar supporting PeekMax, PeekMin, Sum, and PeekNextToMax but I think it was to big a morsel for people to chew on. So I'm splitting it up. ...
4
votes
1answer
160 views

Facility to run code explicitly implemented in a base class that does not follow CA1033

Sometimes when working with components created by a library vendor such as DevExpress you want to extend the components. Good vendors will leave plenty of virtual methods for you to put to use, but ...
6
votes
1answer
69 views

Generic container similar supporting PeekMax, PeekMin, Sum, and PeekNextToMax

I needed to implement a data structure that supports the following operations: create from an existing collection get the maximum item ("Alpha") get the nearest-to-maximum item ("Beta") get the ...
1
vote
1answer
127 views

Initializing local variable to generic interface

Below is my working code written as an exercise in wildcards in generics and Java 8 type inference. My question will be about the commented line in union() method. ...
2
votes
1answer
52 views

Persisting data between HttpRequests in MVC

IMetadata ...
4
votes
1answer
64 views

Metadata Management

Purpose: I've on occasion required a method for changing a (or a set of) Display names (formats, order, etc.). The problem was I'd have to push to production just to change something as simple as ...
8
votes
3answers
195 views

Abstracted Interface for Settings

I just learned about the beauties and wonders of interfaces and I realized how I could fix some code that has been bothering me because of its duplication. This is ...
1
vote
1answer
959 views

Creating a Generic Template Interface/Class and injecting into another object

I would like to create a generic template class for my document processor. Assuming the template has a source file path and a "content", here's what I came up with: Template ...
2
votes
1answer
39 views

Python object modelling with ABCs

I'm modelling the core entities in a callcenter-related system that deals with Operators and groups ("pools") of them. While I've written some Python before, this is my first time building a larger ...
4
votes
1answer
1k views

Representing Objects as strings in VBA

I am working an a more meaningful way to print objects in VBA. The desired result should look something like this. ...
1
vote
1answer
47 views

Managing a collection of object instances and getting them back out with instance manager / service locator

I'm creating an event loop for an asynchronous event execution library for PHP in PHP. Note that this is for a library and not an application. My event loop is just that -- a simple event loop that ...
2
votes
1answer
391 views

IRepository Pattern - Interface Segregation Principle

I have an IRepository class that I use a lot. But I noticed that for many of my repositories I do not implement most of the methods. Also, I usually don't have a ...
4
votes
1answer
103 views

Do you view this ThrowingFunction interface as “interface abuse”?

I am currently implementing a fun project involving lambdas and this project makes heavy use of the ability of Java 8 to have default methods in interfaces. But when does such "heavy use" turn into ...
5
votes
2answers
253 views

Is it ok to add a static method to the IEqualityComparer implementation?

Linq methods like Distinct need IEqualityComparer object. But sometimes I just compares two objects and to create Comparer instance for that is seems redundant. So it would be nice to use static ...
5
votes
1answer
283 views

Drying Up Very Similar Implementations of an Interface

Work continues on the Rubberduck VBA Editor Add-in. I have a need to call some VBA code from the add-in with Application.Run. Unfortunately, the ...
0
votes
2answers
72 views

Would you utilise “Using” on a member which is going to be added to a list? [closed]

I have an interface and a concrete class which I am using in the code below: ...
12
votes
1answer
243 views

Inspector Rubberduck

Our Rubberduck open-source VBE add-in project is coming along nicely. One of the main features we're going to be implementing in the next release, is code inspections. I started by defining an ...
4
votes
1answer
45 views

Less insane interface design for a trigger component for T types?

Disclaimer: I just asked this on the regular SE, but was suggested to post it in here since it's kind of a code review. I've recently been playing around with component frameworks, and I'm trying to ...
7
votes
2answers
461 views

Abstract classes and interfaces in a game inventory system

After reading a lot about interfaces, which I'm new to, I've tried implementing it in my inventory system for a game I'm working on. I have managed to create something proof of concept which seems to ...
1
vote
2answers
76 views

Simple interface and class for holding text to be analyzed

I am making a sentiment analysis library targeted first at social media text (like Twitter) and then I will expand it for more general use. For the first step I am making a simple interface and a ...
2
votes
1answer
52 views

Implement interface type in implementation of another interface without too much casting

I have a group of tests that must be run in similar (but different) fashion and they have setups, results, etc. which are also similar but different. Great, I thought, I'll use interfaces to define ...
3
votes
2answers
155 views

Overly interfaced or not overly interfaced?

I have to take over an old project that was coded in VS 2010 C# 4.0 in 2012. Interface programming seems to be all over the place and over-applied to me, but I am unsure if it is that way. I need to ...
3
votes
1answer
175 views

Public interface for nearest neighbor data structures

I am making a small library of metric data structures. That is data structures, which associate points in the n-dimensional space with objects and allow the user to find objects which are closest to a ...
0
votes
2answers
1k views

Safe DbContext Disposal

I have a service class called ClientService, the service class is called using an interface IClientService. The service class ...