junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
779 stars 112 forks source link

@Wire as convention #328

Closed DaanVanYperen closed 9 years ago

DaanVanYperen commented 9 years ago

@Wire has become convention. It enables one of the core selling points of ODB. For 1.0, perhaps its time to remove the requirement and add an inverse annotation instead.

nikoliazekter commented 9 years ago

What do you mean by inverse annotation? Google doesn't give any results.

antag99 commented 9 years ago

@nikoliazekter Something like an @Ignore annotation, that excludes a field/whole class.

Namek commented 9 years ago

@DoNOTWireArtemisHereOrIWillFeelBadAboutYou - this one would be pretty noticable.

antag99 commented 9 years ago

Why not "@Namek"? (@Wire has suffered enough.)

Namek commented 9 years ago

Because :copyright:

DaanVanYperen commented 9 years ago

Are you suggesting @Namek is not wired? :P

junkdog commented 9 years ago

So, we'd still need @Wire for non-artemis types, but otherwise, everything is automatic? I'd like some perf profiling on android - if the hit isn't too big, let's go with it.

DaanVanYperen commented 9 years ago

Didn't consider the POJO case, it does make sense those will still require manual @Wire tag. If I remember correctly any custom injection handling goes before the POJO @Wire check so plugin devs are still able to define automatic injectables.

This is separate from #335 by the way, the PR doesn't change behavior of @Wire.

Maybe our local android adventurer @snorrees can reveal his thoughts about @Wire by convention. (and @SkipWire equivalent to skip it),.

snorrees commented 9 years ago

I think it will be fine. As long as the number of instances injected are in the amount of 10-100 there should be no problems. Its when you start doing injection for everything these things matter.

I can take this for a spin on my current codebase and report back later if you want? I still have systems with @Mapper annotations o_O, so I think I represent the legacy users.

Just to check: Having an @Wire annotation on a system is ignored in this setup right? I'm basically using "inherit=true" everywhere, so that part should be no problem.

junkdog commented 9 years ago

hehe, @Mapper will go away with 1.0.0

snorrees commented 9 years ago

Good ;)

junkdog commented 9 years ago

Hmm, i'll attend to this tomorrow.