Wolfgang-Schuetzelhofer / jcypher

Java access to Neo4J graph databases at multiple levels of abstraction
Apache License 2.0
86 stars 15 forks source link

Simplify db access factory #18

Closed asomov closed 8 years ago

asomov commented 8 years ago

1) remove code duplication 2) do not use reflection because the instantiated classes are already in the same JAR 3) use switch for enum 4) when this is applied for version 3.3.1 then the tests stay green (I mean this change keeps the tests green)

Wolfgang-Schuetzelhofer commented 8 years ago

Hi Andrey,

The use of reflection is by purpose: If you don't use all variants of dbAccess (REMOTE, EMBEDDED, IN_MEMORY) in your application, which will usually be the case, you can cut dependencies to some libraries. Please have a look at Reduce Dependencies in the project documentation. But in that case not all dbAccess classes can be successfully loaded. To avoid loading them greedily, they are therefore loaded via reflection.