7

In many programs, a Class with the suffix Template exists. For example, org.springframework.web.client.RestTemplate, etc.

What does template mean as a class name suffix? Does it mean the Template Method pattern?

Do you know the reason?

Have a good day.

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Won-Sik Kim
  • 411
  • 3
  • 6
  • 1
    It means the class name ends in the word `Template`; nothing more, nothing less. – Elliott Frisch Mar 30 '16 at 03:23
  • It means whatever the developer wants it to mean. I would assume it's some sort of template, but like I said, it all depends on how the developer that created that class defines template. For all we know, it could be a poorly named class. – Vince Mar 30 '16 at 03:30

1 Answers1

0

No , 'org.springframework.web.client.RestTemplate' is not proper example of 'Template Method Pattern'. It is given name due to its similarity with other classes in spring with suffix as template like 'JDBCTemplate' , 'JMSTemplate'. These classes Both classes , providing a simplified approach with default behaviors for performing complex tasks. Although JDBCTemplate option for user to extend methods like insert and update but Resttemplate does not comply with it.

Panther
  • 3,312
  • 9
  • 27
  • 50