Reputation: 3742
I am building an extension of ORMLite to target Android.
What I want to do
I want to reproduce one of the behavior that Doctrine and Symfony are achieving in PHP with models. In a word:
My question
I was wondering if this is good in practice to try to achieve such an objective on Android or if this will be risky in terms of performance (the heavy usage of inheritance).
If you think that it is clumsy, how can I allow the user to change the .yml file, generate the model and do no start from scratch rebuilding the customized aspects of his model. I know this can be done by some "trick" but I really would like not to reinvent the wheel.
Sorry, I forgot to add: I am using python to do this.
Thanks
Upvotes: 1
Views: 1010
Reputation: 76296
It's the correct, and probably only, Java way. In Java all calls are virtual anyway unless you use final
all over the place, but that means you couldn't even use interfaces. So most calls will probably be virtual dispatch whatever you do. Inheritance does not incur any other significant penalty.
Besides, Android devices are generally so powerful that trying to sqeeze out tiny bits of performance at the cost of readability and maintainability of the program is almost certainly not needed. In fact, most android devices are almost as powerful as web servers that do the same things in much slower PHP and still manage thousands of users while the Android device serves one.
Upvotes: 2