Using T4Template is overdone

Aug 8, 2011 at 6:07 PM

I get satisfaction from CassandraConnectionConfigBuilder. But I feel T4Template is overdone.

T4Template is very useful to generate code from external data. But have rgProperties in itself.

I think code become complex by tt. I want to keep code simple and keep minimam class count. What do you think?

Aug 9, 2011 at 3:50 AM

I'm happy to remove T4 code if you don't like it.

As you can see in CassandraConnectionConfig.designer.cs, most of the code for each property are the same. Using templating engine helps me not to forget to add code when adding properties. For example, when you add a property to CassandraConnectionConfig, you have to add the same property to CassandraConnectionConfigBuilder, and add lines to copy properties between the two classes, etc. Developers can do that by hand, but doesn't template engine help?

In my opinion, the core of T4 (and any other templating engines) is the ability to generate code of the same patterns, and is not about whether the data is external or internal. I just don't like copying code which can makes maintenance harder.

The use of new technology can reduce the amount of work, while requires knowledge to use, so it makes thing in both more complex and simpler directions.

If you still think its complex part wins over simpler part and prefer not to use it, can you please confirm so that I can remove it?

Aug 9, 2011 at 3:51 AM

Oh, by the way, I'm glad that you liked the design of CassandraConnectionConfigBuilder. Thank you about that.

Aug 9, 2011 at 4:33 AM

Umm, I still think it is complex. If this project members are only you and me forever, T4 will bring good effect. But other member don't know background will come in, then he take a little time to understand it.

I make workitem. If you counter my opinion, please comment to workitem:20.