Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain classes with the target DB #7

Open
jdavo opened this issue Jun 13, 2012 · 3 comments
Open

domain classes with the target DB #7

jdavo opened this issue Jun 13, 2012 · 3 comments
Assignees

Comments

@jdavo
Copy link
Collaborator

jdavo commented Jun 13, 2012

When obtaining a template, the code needs to know the domain classes attached to that DB instance and the DB version.
It would be nice if the ORM bootstrap process was able to

  1. search the code base for domain classes
  2. work out which classes map to which database instance(s) and the target DB version
  3. provide a DBHelper broker which

The issue with this is the first part, where I was having problems dynamically finding .class files, possibly due to the application protection mechanism in Android, but possibly because I was not doinf it correctly. It was based on FindClasses in Bear Bibeault's FrontMan

It would also require the developer to know which domain classes are in he same DB and which are in different DB instances to ensure that they talk to the correct template instance. Otherwise the broker could act as a proxy to one or more template instances, as many as is required to perform the desired operations, and internally route the query to the correct template instance.

@ghost ghost assigned jdavo Jun 13, 2012
@jdavo
Copy link
Collaborator Author

jdavo commented Jun 13, 2012

eg

    @Domain(databaseName="ormtest", databaseVersion=3)
    public class Address {

@bytor99999
Copy link
Owner

But for the majority of Android apps they just need very basic tables and
objects with just on database, which they created and created their own
tables that they already know about. Including the version of the database.

But I can see how that would be a problem if they got a bit more complex.
Maybe by not having that, we can keep them keeping it simple?? ;)

Anyway, I think I put that in that way more about being lazy and not
knowing of anyway to automatically detect that information.

Mark

On Tue, Jun 12, 2012 at 7:16 PM, David O'Meara <
[email protected]

wrote:

When obtaining a template, the code needs to know the domain classes
attached to that DB instance and the DB version.
It would be nice if the ORM bootstrap process was able to

  1. search the code base for domain classes
  2. work out which classes map to which database instance(s) and the target
    DB version
  3. provide a DBHelper broker which

The issue with this is the first part, where I was having problems
dynamically finding .class files, possibly due to the application
protection mechanism in Android, but possibly because I was not doinf it
correctly. It was based on FindClasses in Bear Bibeault's FrontMan

It would also require the developer to know which domain classes are in he
same DB and which are in different DB instances to ensure that they talk to
the correct template instance. Otherwise the broker could act as a proxy to
one or more template instances, as many as is required to perform the
desired operations, and internally route the query to the correct template
instance.


Reply to this email directly or view it on GitHub:
#7

@jdavo
Copy link
Collaborator Author

jdavo commented Jun 13, 2012

It could be overblown, but I find code littered with db names and db versions, and when coupled with the fact that the dev also needs to supply an array of supported domain Classes each time they want to access the persistence layer it makes sense to (at least) consider adding the functionality, although I suspect that you're right and the effort either way may be much the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants