Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6204477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:06:00+00:00 2026-05-24T05:06:00+00:00

I noticed the following in the introduction for StringTemplate: StringTemplate interprets o.p by looking

  • 0

I noticed the following in the introduction for StringTemplate:

StringTemplate interprets o.p by
looking for property p within object
o. The lookup rules differ slightly
between language ports, but in general
they follow the old JavaBeans naming
convention. StringTemplate looks for
methods getP(), isP(), hasP() first.
If it fails to find one of those
methods, it looks for a field called
p.

This doesn’t seem to jive with this paper: http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Doesn’t this open the door for violations of model/view separation, by essentially allowing the model to pull data by calling a method? A bad programmer could write a method getP() that causes side effects. How does ST “strictly” enforce the separation of concerns here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:06:01+00:00Added an answer on May 24, 2026 at 5:06 am

    Every single templating language out there does exactly that, Velocity, FreeMarker, StringTemplate and JSP/JSF Expression Language.

    The separation of concerns is something the programmer should care about, not the view. People are expected to write side-effect free get/is/has methods so that anyone can call them without having to care about this. That’s why these methods are supposed to be accessors and there are methods usually called with setSomething that are supposed to be mutators.

    If someone writes their own classes and decides to define a getSomething method that has a side effect, they are going against the common belief and the tools are not supposed to take every single assumption when dealing with objects, they just hope people will be intelligent and will respect the common sense and write code as everyone else writes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed the following in the Java Language spec in the section on enumerations
I was looking at the metadata for System.Web.Configuration.CompilationSection, and noticed the following attribute on
I was looking at the source of a greasemonkey userscript and noticed the following
I'm looking at some Java code, and I've noticed the following: if (!foo(bar, baz,
I'm crossfading between two views using UIView animation. I've noticed the following surprising fact:
I've noticed the following pattern recently, but I don't entirely grasp the usage of
I was writing a pluginable function when I noticed the following behavior (tested in
I've been playing around with Spring Security a bit and noticed the following oddity.
I noticed C++ will not compile the following: class No_Good { static double const
I noticed for a while now the following syntax in some of our code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.