Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
0
votes
2answers
77 views
0
votes
4answers
59 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:
...
1
vote
2answers
109 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
111 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
31 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
73 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
30 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
33 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
96 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
100 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
220 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:
...
1
vote
1answer
51 views
Complicated inheritance [closed]
I found the below code in our code base at work, and I think it looks strange. The class RetainCounting is used for implementing reference counting.
Should the IProvider really derive from ...
6
votes
2answers
178 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
60 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
479 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
85 views
Simple Vector2 structures (and interface)
I built a couple Vector2 structures (Vector2 and Vector2F) for use with a particular ...
1
vote
2answers
36 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
161 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
42 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
159 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
183 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
50 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
137 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
67 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
120 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
50 views
4
votes
1answer
60 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
187 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
771 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
949 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 ...
1
vote
1answer
347 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
88 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
220 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
281 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
242 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
44 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
417 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
51 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
154 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
172 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 ...
2
votes
2answers
197 views
Generic data interface
I currently have the following working code. I am looking for some suggestion with best practices and perhaps a better way to accomplish my goal.
Goal: - in short - Have a generic data interface as ...
0
votes
1answer
781 views
Polymorphic template cloning class
I have a requirement of a templated clone() method which Base classes can implement through an ICloneable interface and all the ...
10
votes
2answers
369 views
PDO connection via INI parser classes
A few days ago I asked this question and I've got an answer to work with interfaces. I've tweaked around with this to get myself a INI parser class.
...
0
votes
1answer
2k views
Mapping interface between POJOs and DTOs
Following up on this question DTO interfaces for implementing web service integration I came up with this implementation.
Data Transfer Object interface following a java.util.Map protocol. The ...