All of my domain objects follow a very similar structure, if I wanted to store Address objects in my application, I would create in a .address package an Address, IAddressService, AddressServiceImpl, as wel开发者_高级运维l as an AddressServiceImplTest in a corresponding test package. All of these objects seem like they could be easily templated, however I usually find myself just copying a similar domain object and renaming classes manually.
Is there a template method in eclipse, or a plugin, that could autogenerate several classes and several packages in one shot for this type of scenario?
I am not aware of a prebuilt solution. However, you can consider writing your own, specialized template engine using Java Emitter Templates.
精彩评论