Questions tagged [concreteclass]
34 questions
1
vote
1 answer
Pattern for Compositions of Abstract Objects
I have an abstract class that has an array of abstract things:
Abstract Color has abstract ColorThings[]
I have several concrete classes that each have an array of concrete things:
Concrete RedColor has concrete RedThings[]
Concrete BlueColor has…

redeveloper
- 119
- 7
1
vote
3 answers
Can I Avoid Implementing Parameterized Constructors in Sub-classes
I have an abstract class with a 1-param constructor which should be identical for any concrete sub-class. Does every concrete sub-class have to have that same 1-param constructor, and if so, why?
Abstract:
public abstract class AbstractClass…

redeveloper
- 119
- 7
1
vote
4 answers
.NET: Select concrete classes using config file
(This question specifically in C#, but applies generally to .NET)
I have a largish application that has a fairly good design, and is broken into major sections over interfaces (this was done to assist parallel development).
We now have a primary…

Stewart Johnson
- 14,281
- 7
- 61
- 70
1
vote
1 answer
Concrete classes vs interfaces: When to use?
I am pretty aware of the benefits of interfaces and how it helps aggregate common functionality of similar types of objects. However I believe people have taken this 'always program to an interface' a bit too far.
a) People starting off by ALWAYS…

bobbyalex
- 2,681
- 3
- 30
- 51
1
vote
1 answer
Best practice: Spring Autowired, concrete class, and Builder
We have an interface:
public interface NotifyService {
public void send();
And a class that implements it
public class EmailNotifyService implements NotifyService {
private EmailBuilder _builder;
@Autowired
PersonRepository…

Robert Bowen
- 487
- 2
- 13
- 24
0
votes
0 answers
`debug_backtrace()` reports abstract classes in trace rather than concrete classes. Is there a fix?
I wrote the following code which turns the result of debug_backtrace() into a string:
function debug_backtrace_string($skip = 1)
{
try
{
$calls = debug_backtrace();
$calls = array_slice($calls, $skip);
$str = [];
…

Jodes
- 14,118
- 26
- 97
- 156
0
votes
0 answers
How to include class file in custom block ( Concrete CMS 5)
How to load the class file into Custom blocks.
I have created a custom block. and I need to include one class file into multiple files. so could you please guide me?
Please see attached…

Hitesh Techarck
- 21
- 4
0
votes
1 answer
Python mypy marks error when method parameter is type Union
I have these python classes:
class LocalWritable(typing.TypedDict):
file_name: str
class GSheetWritable(typing.TypedDict):
tab_name: str
class S3Writable(typing.TypedDict):
data_name: str
table_name: str
WriterMeta =…

HuLu ViCa
- 5,077
- 10
- 43
- 93
0
votes
1 answer
.NET Core Dependency Injection for model class
I have a one solution and it contains one .NET Core Windows Service project. And, I am consuming a .NET Standard custom NuGet package. My code structure is like below :
public class MyCustomPackage
{
private readonly IDependentService;
…

sharmila
- 65
- 6
0
votes
1 answer
Get an instance to inherit another instance's constraints in pyomo
I'm trying to create an instance that inherits another instance's constraints, whilst adding some new ones.
Is there a way to "copy" the previous instance's constraints into the new one?
Here's a snippet from the code
...
model.bnb_bound_constraints…

Pablo Pablo
- 165
- 10
0
votes
0 answers
Declaring a variable of unknown type that conforms to a protocol?
Is it possible to declare a variable of an unknown concrete type that conforms to one or more protocols?
class A: Codable {
...
}
class B: Codable {
...
}
class Serializer {
static func serializeFromJSON(type: T.Type, dict:…

GoldenJoe
- 7,874
- 7
- 53
- 92
0
votes
1 answer
Design process for interfaces and classes used in dependency injection scenarios when implementations are so different
Using services that extract data from web pages as an example (for instance Mercury https://mercury.postlight.com/web-parser/ or Diffobt https://www.diffbot.com/products/automatic/#article) I want to ask a question about how to construct the…

Robert
- 353
- 3
- 14
0
votes
2 answers
Concrete Class implements a interface. Typecasted to Interface later. How does JVM recognize the Typecasted instance?
A Concrete class typecasted to interface, does JVM still consider it a instance of concrete class ?

Carbonizer
- 1,915
- 2
- 19
- 22
0
votes
1 answer
Using concrete class from a abstract type variable
I'm sorry if this question has been asked already, I haven't found anything like my question yet...
I'm working/playing/learning to build up some kind of testing environment... Inside it, I'm building an Application Layer (a package of classes that…

cimonfortierg
- 65
- 6
0
votes
2 answers
Getting duplicate fields when setting from Concrete class
I need to define constant values in each ConcreteClass that extends AbstractClass. For some reason object ends up having duplicate fields, one set of fields is equal to zeros, next one has proper values.
SomeInterface
public interface…

J.Olufsen
- 13,415
- 44
- 120
- 185