Multiple model classes

Admin note: Moved to new thread. Please post new questions in a new thread in the Q&A section, rather than replying to an announcement!

Is it possible (or wise) to have multiple model classes for a class?

I’m intrigued!

What’s the use case? What are you trying to do where you might need this?

I don’t really have a specific use case in mind TBH. I was mostly just curious!

A hypothetical situation would be if there is a sprawling database; I could imagine different modules wanting to do different things with the database. E.g. say due to tech debt both demographic info and user settings in the user table. If different teams maintain the demographic info module and user setting module, I could see them not wanting to both be touching the same model class.

I haven’t tested, but I think that there is only one registered class returned by the search iterator, because there is no way to tell “search x and return this or that class”.

You can have one class derived from a table’s row, then multiple classes derived from that class. And you can have different apps accessing the same shared table with different classes, but each app can only have one class per table.

3 Likes

Well… server and client can each have their own distinct class, but that’s it.