Skip to main content

All Questions

Tagged with
0 votes
3 answers
251 views

Using "Generics" to implement "Unit Of Work"

I need to design a generic "Unit Of Work", basically so that I can "change the context of the Database" only changing the implementation of ...
Igor's user avatar
  • 182
5 votes
1 answer
202 views

Service for generating faked objects

I'm using the Bogus library to mock up some data for testing. This is my main method demonstrating how the faking service should be used: ...
TomSelleck's user avatar
2 votes
1 answer
460 views

Handling related generic type parameters

In answering a question on StackOverflow, it occurred to me that a more generic version of GroupBy for C# that delegated membership in each group to a class could ...
NetMage's user avatar
  • 412
0 votes
1 answer
87 views

Using a wrapper on a primitive as a generic for an interface used for Java lambda

I apologize for that title, lol. I have a Java method that I'm writing where I want to be able to pass in an array of Objects and two interfaces that will be used for lambda expressions that specify ...
Devsman's user avatar
  • 113
2 votes
1 answer
3k views

Implementation of generic unordered list in java

This question is a follow-up question of this question. These features are added to the new class - Generic class User is capable of setting the size ...
Hamidur Rahman's user avatar
5 votes
1 answer
2k views

Processor for handling generic commands

I'm trying to implement business logic layer based on concepts of commands and command handlers. A command is a thing that contains input parameters for executing some action, and it knows what kind ...
Andre Borges's user avatar
9 votes
5 answers
658 views

Declarative type comparer

Writing comparers by either implementing the IEqualityComparer<T> or the IEquatable<T> interface is another boring ...
t3chb0t's user avatar
  • 44.3k
3 votes
1 answer
88 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 ...
Airn5475's user avatar
  • 131
1 vote
1 answer
2k 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. ...
PM 77-1's user avatar
  • 597
1 vote
1 answer
6k 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 ...
Cody's user avatar
  • 241
3 votes
1 answer
114 views

Functional interface uses uncheck or unsafe operations

First of all, I am absolutely surprised that this code even works. Originally what I did was create a version checking system for Minecraft plugins (specifically Bukkit, Craftbukkit, & Spigot). ...
Nikolaii99's user avatar
12 votes
2 answers
3k views

Instantiating a run-time implementation of an interface

Below is my code that was written for the following task (based on an SO question): Given a Java Collection (of N elements) create an ...
PM 77-1's user avatar
  • 597
14 votes
4 answers
2k views

Reusability vs simplicity in a small game with a set of interfaces

I have a small game I'm working on with a set of interfaces: IHavePosition: ...
Nick Udell's user avatar
  • 5,197
2 votes
1 answer
198 views

Many interfaces and lots of inheritance vs few interfaces and less inheritance? [closed]

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 ...
Gup3rSuR4c's user avatar
11 votes
2 answers
11k 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 ...
Rondles's user avatar
  • 213

15 30 50 per page