Domain modeling question - Application Forms System

I work for a jazz organization and I am going to be building a system to handle application forms for a touring bands program we have. The application forms (which bands fill out to apply to the program) are quite extensive and involve multiple file uploads, a subform for each band member, and other non-trivial features.

Rather than make the form specific to just this application, we were thinking of writing the system in a more generic way and then releasing it as an open-source project (probably a Joomla component if I can get Doctrine ORM version 2 to work well in Joomla).

The attached image shows the UML diagram I’ve created (still a work in progress).

The part I’m having trouble with is how the sub-applications should be handled. Right now I have the ApplicationForm class and the Application class (which is for actual application instances filled out by the bands) both containing references to their respective sub-application objects. I’m just wondering if this is the best way to go about it.

Please don’t be confused by the rest of the diagram; I have the rest of it mostly figured out, I just included the whole diagram for context.

If you think I could simplify my question or explain it better, please let me know.

Thanks a lot,
Matt

That’s usually a very dangerous route to take. Chances are that you’ll put abstractions in the wrong places, making you framework rigid and convoluted. I would suggest that you start out by writing your application to fit the exact needs (nothing less and nothing more) that you have right now. Once that works, you can try to abstract it out.

Thanks for the response, I was wondering if this might be too ambitious… I was planning on using a CQRS (command query responsibility segregation) architecture so that at least the query/read side of the application would be fairly simple (although the command/write side could get quite complicated).

But it is probably better like you say to just write it for specific needs first. On the other hand, I can think of a number of survey applications that take a fairly abstract route, and let you create surveys with any number of questions and calculate statistics on the results, so clearly that level of abstraction can work.

Anyway, thanks for stopping me before I got ahead of myself - a voice of reason from an experienced architect/programmer is always appreciated :slight_smile: