The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
4answers
329 views

Is it bad programming practice to check if a class referenced by its interface is an instance of another class?

I have a class (Timer) with an array list of Timable objects. Timeable is an interface. There is some specific functionality that I need for the Trigger class (implements Timable), which has a ...
-1
votes
1answer
54 views

Writing data driven reflection based tests to ensure design completeness [closed]

When writing software I'm often forced to at some point to make a decision that involves a design pattern of "by convention" naming and behavioral patterns. This normally makes me feel kind of slimy ...
0
votes
0answers
33 views

Uniqueness: “automatic detection” using reflection or by abstract method implementation

I'm creating a framework for a certain use case. The framework uses spring data and JPA and provides abstract entities and services the user must extend according to his needs. The service classes ...
3
votes
4answers
312 views

Is storing types in the database an anti pattern?

A little background on where this question is coming from. In my current .NET application I'm working on some features related to archiving a certain type of business entity called a "Project". ...
4
votes
2answers
614 views

Is it a bad habit to (over)use reflection?

Is it a good practice to use reflection if greatly reduces the quantity of boilerplate code? Basically there is a trade-off between performance and maybe readability on one side and ...
3
votes
6answers
458 views

In Java, would you sacrifice type safety for a nicer programming interface

When and why would you generally sacrifice typesafety for a nicer programming interface? Let me give you an example: if you had the choice between two event aggregators, which one would you prefer ...
3
votes
2answers
93 views

Determining which decorator classes are available via reflection

I'm creating a pizza place application where employees will be able to create orders for customers(pizza and any number of toppings). This is for a school project but the requirements have nothing to ...
4
votes
2answers
226 views

How to create contracts in python

I am currently learning Python (from Java) and have a question on contracts. Example: an application defines an interface that all plugins must implement and then the main application can call it. ...
6
votes
2answers
338 views

Are there any reliable solutions for annotations/reflection/code-metadata in C?

Not all languages support java-like annotations or C#-like attributes or code metadata in general, however that doesn't mean it is not possible to have in languages that don't have this. An example ...
-2
votes
5answers
847 views

Why is Java's reflection package considered the dark side of the force? [duplicate]

Possible Duplicate: Why should I use reflection? Does it allow access to private members which would otherwise be inaccessible, thus breaking the intentions of the original design ? Is it ...
7
votes
1answer
516 views

Why isn't reflection on the SCJP / OCJP?

I read through Kathy Sierra's SCJP study guide and I will read it again more throughly to improve myself as a Java programmer and be able to take the certification either Java 6 or wait for the Java 7 ...
6
votes
3answers
1k views

Reflection: Is using reflection still “bad” or “slow”? What has changed with reflection since 2002?

I've noticed when dealing with Expressions or Expression Trees I'm using reflection a lot to set and get values in properties and what have you. It has occurred to me that the use of reflection seems ...
2
votes
2answers
201 views

Reflection and the LGPL

Simply, If I use reflection to add methods or functionality to a class defined in a LGPL'd library I'm linking to, does that count as a modification to the existing library and would my reflective ...
4
votes
5answers
5k views

Why should I use reflection?

I am new to Java; through my studies, I read that reflection is used to invoke classes and methods, and to know which methods are implemented or not. When should I use reflection, and what is the ...
4
votes
2answers
234 views

Is it bad practice to use reflection to do DB inserts with data from an external service?

Our supplier's webservice is returning address objects (~30 fields) and I'm using LINQ and reflection to store the returned data straight into the databse. I loop over the attributes and set the value ...
14
votes
4answers
1k views

Is Java instanceof operator considered reflection, and what defines reflection?

I had a discussion with a coworker today, whether usage of using the Java operator instanceof is a kind of reflection. And the discussion quickly evolved into what actually defines reflection. So, ...
10
votes
3answers
197 views

Do I need to deal with the situation where private methods are called through reflection?

When creating a library, must I ensure that the private methods must work as expected when called not by other methods of the same class, but by another library through reflection? For example, if a ...