D
Deleted User
Guest
Hi,
I'm digging into Android and Java here and I've a question regarding code architecture in Java.
(Note: My programming experience is C++ and then .NET, so I'm sure you'll understand)
Say, for whatever reason, I have two Activities with lists that pull and populate from the same table in the application's database. Obviously I want this code modularized.
My gut is telling me, since Java is all about OOP, I'll need to create an object that represents that data and both Activities will just instantiate and use that object.
What I want to do is create a package that contains .java files of common methods modularized out. These .java files don't really represent any particular object (though they may be organized appropriately). They're just a code dump of related methods.
Is the latter strictly against Java ideology? Should I strictly adhere to the former? I want to use whatever method is appropriate for programming in Java, but from programming in C++ and .NET, I've always had common files of code that can be used anywhere.
Thanks for your time,
Andrew
I'm digging into Android and Java here and I've a question regarding code architecture in Java.
(Note: My programming experience is C++ and then .NET, so I'm sure you'll understand)
Say, for whatever reason, I have two Activities with lists that pull and populate from the same table in the application's database. Obviously I want this code modularized.
My gut is telling me, since Java is all about OOP, I'll need to create an object that represents that data and both Activities will just instantiate and use that object.
What I want to do is create a package that contains .java files of common methods modularized out. These .java files don't really represent any particular object (though they may be organized appropriately). They're just a code dump of related methods.
Is the latter strictly against Java ideology? Should I strictly adhere to the former? I want to use whatever method is appropriate for programming in Java, but from programming in C++ and .NET, I've always had common files of code that can be used anywhere.
Thanks for your time,
Andrew