Play2에서는 Scala를 템플릿 엔진으로 쓰고 있습니다. 그러면서 Play 공식 사이트에서 다음과 같은 특징을 Scala 템플릿의 강점이라고 이야기합니다.


Play 2.0 comes with a new and really powerful Scala-based template engine, whose design was inspired by ASP.NET Razor. Specifically it is:

  • compact, expressive, and fluid: it minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow. Unlike most template syntaxes, you do not need to interrupt your coding to explicitly denote server blocks within your HTML. The parser is smart enough to infer this from your code. This enables a really compact and expressive syntax which is clean, fast and fun to type.
  • easy to learn: it allows you to quickly become productive, with a minimum of concepts. You use simple Scala constructs and all your existing HTML skills.
  • not a new language: we consciously chose not to create a new language. Instead we wanted to enable Scala developers to use their existing Scala language skills, and deliver a template markup syntax that enables an awesome HTML construction workflow.
  • editable in any text editor: it doesn’t require a specific tool and enables you to be productive in any plain old text editor.

 

글 중간에 보면 ASP.NET의 Razor에서 영감을 받았다고 되어 있네요. Razor가 어떤 템플릿이었는지 좀 찾아보다가  Razor를 소개하는 블로그 글을 하나 발견했습니다.  일부 옮겨 봤습니다.


Design Goals

We had several design goals in mind as we prototyped and evaluated “Razor”:

  • Compact, Expressive, and Fluid: Razor minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow. Unlike most template syntaxes, you do not need to interrupt your coding to explicitly denote server blocks within your HTML. The parser is smart enough to infer this from your code. This enables a really compact and expressive syntax which is clean, fast and fun to type.

  • Easy to Learn: Razor is easy to learn and enables you to quickly be productive with a minimum of concepts. You use all your existing language and HTML skills.

  • Is not a new language: We consciously chose not to create a new imperative language with Razor. Instead we wanted to enable developers to use their existing C#/VB (or other) language skills with Razor, and deliver a template markup syntax that enables an awesome HTML construction workflow with your language of choice.

  • Works with any Text Editor: Razor doesn’t require a specific tool and enables you to be productive in any plain old text editor (notepad works great).


영감을 받은 수준이 아닌거 같네요. :-) Play2 템플릿으로 작업하다가 막히면 Razor 예제 찾아보면 될거 같습니다.

저작자 표시 비영리 변경 금지

'Work & Study > TechTalk' 카테고리의 다른 글

Java Social Library  (1) 2012/05/04
Play for Java  (0) 2012/04/30
Play 템플릿 엔진과 Razor는 쌍둥이  (0) 2012/04/25
Play Framework을 공부하자. 2  (0) 2012/04/18
Play Framework을 공부하자.  (0) 2012/01/30
Eclipse에서 CDT로 개발하기  (0) 2012/01/25