Questions tagged [interface]

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

Filter by
Sorted by
Tagged with
-2
votes
1answer
221 views

Parsing various types of message strings

Similar question MessageFormat: represents the various kinds of messages. (XML, JSON, ...
4
votes
0answers
575 views

Implement OO interfaces in Python

Edit: Whoops! I just remembered there's already an long-lived package for this, zope.interface. I'd like a review all the same. This is a proof-of-concept ...
4
votes
2answers
581 views
15
votes
2answers
2k views

Using events together with interfaces in VBA

Introduction Because of the limitation of VBA in using events in interfaces I was searching for a kind of workaround. For sure I also read this which also provides an approach, but I was searching ...
3
votes
3answers
507 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 ...
3
votes
0answers
52 views

Extensible Python Interfaces

Some background before the actual code: My team needs to develop an optimization library for a specific problem. In order to optimize (pun intended) the projects life-cycle I am trying to write some ...
3
votes
1answer
630 views

Scala traits for arithmetic expressions

I am learning Scala and want to know, what is preferred style of writing a function for a trait. First: ...
9
votes
1answer
316 views

Trie implementation for a data structure library in C

I'm implementing a trie structure for a library, as an exercise in data structures. Details The tree structure is represented as a doubly chained tree. A struct ...
4
votes
1answer
61 views

Fetching files or directories in a given directory

This is a self-teaching implementation to get files for a given directory in order to simplify os.Walk in Go (avoid to pass a func for recursively walking across ...
6
votes
2answers
132 views

A simple program which returns specific value from array

After researching for an hour regarding SOLID Principles, I tried to do it myself. Please note that most of these codes were from the ideas of others. I created a simple program which returns ...
2
votes
1answer
97 views

Handing multiple workflows cleanly in LOB application

Background I'm about to build a LOB application that resembles an e-commerce solution (without paying and being open to the public). It will be used to receive orders for fulfillment purposes based ...
1
vote
1answer
1k 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 : ...
2
votes
2answers
86 views

Represent a person who has different roles for different offices

People have different types of roles depending on the office they are working at. For example, a person has two roles (cashier,cleaner) at OfficeMax and five roles(manager,security,etc) at OfficeLess. ...
1
vote
1answer
25 views

Multiple Interfaces modifying contract

I have a problem with my interface-design. I especially ask for help with the overloaded compute-Method. For a calculator I work with these Interfaces: ...
3
votes
1answer
193 views

jQuery plugin boilerplate jquib

Inspired by jqueryboilerplate.com, I extended their boilerplate to fit my needs. Coming from PHP development, I wanted to have a good starting point for writing jQuery plugins with a defined API/...
3
votes
1answer
2k views

Classes representing items in an RPG game

I wrote a little program in C# that contains classes representing Items in RPG game. I wanted to have access to all inherited classes parameters from list contains parent Item class instances, so this ...
1
vote
0answers
877 views

Interface for Dapper repository

I'm creating a little proposal for the data access layer using Dapper ORM. The code is based in an generic interface IStore: ...
6
votes
1answer
2k views

Generating RPG Characters (Objects)

I am a beginner Java programmer. I have just finished up an assignment and would appreciate some advice and/or constructive criticism on my program. I am trying to ensure I do not advance my knowledge ...
4
votes
3answers
3k views

Generating 50 Random Shapes

I am a beginner Java programmer. I have just finished up an assignment and would appreciate some advice and/or constructive criticism on my program. For context, I have the assignment details, ...
2
votes
0answers
61 views

Expression validator service

I'm working on a project (in C++98) that uses a grammar validation service to validate mapping expressions for a small DSL. To simplify the project code, I've written a small interface for using the ...
4
votes
2answers
2k views

Automatic IEqualityComparer<T>

There are APIs like the Except extension that require the IEqualityComparer<T> to work. I find it's too much work for such ...
0
votes
2answers
193 views

Very complicated Java HelloWorld app

This program attempts to shows the basic concepts of inheritance and polymorphism. In what ways could the code be modified to better demonstrate those concepts? The interface, abstract class and the ...
4
votes
2answers
31k views

Animals, inheritance and interfaces

I am trying to fully understand interfaces and abstract classes in Java and from what I understood, I created a sample console application. Is there an error in the design or is this basically what ...
6
votes
2answers
351 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 ...
2
votes
0answers
130 views

Safest Connection pool in Java

I have read the code reviews on this website: this one and this one So creating the pool in itself might not be that difficult, I'm more worried about the client closing the connection or the ...
3
votes
1answer
67 views

Validation rules with support for immediate termination of processing

I am picking up a code smell from this code and I am not sure of the best way to rid myself of it. I have a validation class that has a function that returns a list of ...
1
vote
1answer
67 views

Trying to implement cross-class functionality that needs a field to operate in C#

Crosspost from here, it was suggested that this is better place to pose my question. I'm implementing a series of classes in a game that all derive from one base class that references the scripting ...
1
vote
2answers
80 views

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 ...
3
votes
1answer
103 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
80 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. ...
1
vote
2answers
161 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: ...
11
votes
2answers
9k 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: I have my interface which defines what a spreadsheet ...
0
votes
4answers
97 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
137 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
2answers
835 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: ...
2
votes
0answers
115 views

Interface modelling for a journaling program in Java

My program's Journal consists of unique Pages identified by their Day. Within those pages ...
0
votes
1answer
994 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
52 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. ...
2
votes
1answer
213 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 ...
2
votes
1answer
64 views

Persisting data between HttpRequests in MVC

IMetadata ...
1
vote
1answer
7k views

Common interface with different return types [closed]

I am creating a small app working on file system. The user can choose a directory and than, application get one of the possible result (examples): return number of lines in all *.java files return ...
5
votes
1answer
113 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
143 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 ...
8
votes
3answers
494 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 ...
3
votes
1answer
155 views

Interface for a CRM system

I have a CRM system that has Notes, Payments, DairyEvents and anything else that needs to be bolt on over time. I created an ITimeline interface that has a ...
7
votes
3answers
976 views

Interface for server requests and responses

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 ...
4
votes
1answer
349 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 ...
7
votes
1answer
14k 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: <...
2
votes
4answers
235 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: ...