MySQL design problem
My question is this, is there a way to dynamically generate Object 3 through MySQL.


When I hear "generate," I tend to interpret that as "insert," but I think you're asking whether MySQL could dynamically select and return the appropriate related records to the application based on certain criteria.

If that's what you're asking, then it seems you have correctly surmised that one sensible way to implement that is indeed with stored procedures...


  Also I've read that I shouldn't use stored procedures, and instead do everything with code


Nonsense, I say.  Disregard that advice.  Stored procedures, used properly, can be used to build an excellent interface between the database tables and the application.  

One aspect in particular seems to suit your request:


  MySQL supports a very useful extension that enables the use of regular SELECT statements (that is, without using cursors or local variables) inside a stored procedure. The result set of such a query is simply sent directly to the client. Multiple SELECT statements generate multiple result sets, so the client must use a MySQL client library that supports multiple result sets. -- http://dev.mysql.com/doc/refman/5.5/en/stored-routines-syntax.html


Of course, like any other tool, there are inevitably people who come up with ways of misusing them, but this doesn't reflect on the suitability of the tool when properly applied.

But a single call to the database from your application could retrieve the primary object and related data, with stored procedures.


  I was thinking of creating a separate table top hold primary keys of related objects


That sounds like you're describing a junction table...


  but I'm thinking there is probably a better way of doing that.


If the relationship among objects is many-to-many, then this is the appropriate way of expressing that relationship... but not when it isn't.