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
0answers
13 views
Default method implementation to override abstract method [on hold]
I would like to have an abstract method implementation left to an interface's default method. This fails to compile with the error message saying that the TestClass needs to be either abstract or ...
-1
votes
0answers
10 views
How might this Java implementation for a Car class implementing the Cloneable interface be incorrect? [closed]
Consider the following classes:
...
5
votes
1answer
70 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
94 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
36 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
242 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 ...
-1
votes
2answers
110 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 ...
3
votes
2answers
130 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 ...
1
vote
1answer
44 views
Multiple payment gateway implementation solution [closed]
I have been working on a requirement to implement payment gateway integration for my web application I wanted to implement a generic solution were it is possible to plugin multiple payment providers.
...
2
votes
0answers
67 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
40 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
0answers
61 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:
...
0
votes
0answers
62 views
Library to query Edmunds' API
I'm attempting to create a library to query Edmunds' API. I'm not sure if the design is over-engineered and would like some feedback. Here is the code:
The API class (takes and endpoint and ...
1
vote
1answer
62 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 ...
0
votes
0answers
48 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 ...
7
votes
5answers
759 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
199 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
46 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
70 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
86 views
0
votes
4answers
66 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
166 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
123 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
62 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
105 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
137 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
38 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
106 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
66 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
114 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
229 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
216 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
62 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
771 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
162 views
Simple Vector2 structures (and interface)
I built a couple Vector2 structures (Vector2 and Vector2F) for use with a particular project,...
1
vote
2answers
38 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
280 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
46 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
215 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
284 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
69 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
205 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
75 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
139 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
53 views
4
votes
1answer
70 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
213 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
2k 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
45 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
2k 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.
...