Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: Apache JDBC utils Date: Thu, 03 May 2012 00:14:21 +0200 Organization: albasani.net Lines: 47 Message-ID: References: <28822840.1257.1335993779644.JavaMail.geo-discussion-forums@pbbpz9> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net BZz+acYPpSkGMgXdVWRwhGpYW+zEOAKcJ7r9ZBxBHbAOOr4HGJqZPLdxeJ/aJbOPy8ysL7SuxqgmFP6i2M/hIFwDaQzEkqBbCbjOal+jh9wdna/LUVYmjimVw+Aemk/2 NNTP-Posting-Date: Wed, 2 May 2012 22:14:21 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="xJ3VFt77PXdWlnGqKAR+mQ6iaVhYgkb+W4cy/QE/MJwLDXLKyhL08lVt1FNTzc2H5wE8Gg2CS0pKu4kKlg2PioF/63Id7eVl8UEQP2IUxRkh9cioffD+Ndmim7SN1eT/"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120429 Firefox/12.0 SeaMonkey/2.9.1 In-Reply-To: Cancel-Lock: sha1:KsLJ4Hp4lA3nOW9MlA96H9Er9y4= Xref: csiph.com comp.lang.java.programmer:14159 Jan Burse schrieb: > It has more been a conceptual issue in > matula how to generate XXXBean. But you > can of course plug-in your preffered > template language in the below flow: > > +--------+ +-------------+ > | DB | | .properties | > +--------+ +-------------+ > | | > ------ ----- > | | > v v > +--------+ > |>>Here<<| > +--------+ > | > v > +------------+ > | XXXBean | > +------------+ Advantage of using a template processor where templates show the output generation of the XXXBean basically as Java code with holes in it, is the easy prototyping of the templates. Just take some code you have already written, and that worked. And then generalize it by making the holes into it and write code around it that fills the holes. Other less textual approaches would include generating an AST, which is then textualized. Generating an AST can be of one more advantage than the template approach, since it would allow non linear generation of the output. And one could also use updates as part of the AST generation. Templates with linearly interwined code are best suited for code generation when the code generation also follows some linear flow. So when the output resembles a regular or context free grammar. Something along these lines. Bye