It looks like you are advocating the use of a custom table data source web part to output the object? In that scenario, where would you define the c# code? I'm currently using a runat=server script tag in my page's ASCX layout to do the serialization of the in-line dummy object literal
What if the source object is a query result of a custom page type? I have bunch of objects of a custom page type where I would like to output a specific view of these pages as a JSON string.
I dont' believe there is a data source web part where I can setup the data query.