简体   繁体   中英

Implementing Template Method Design Pattern in RESTful services Java

Anyone tried implementing Template Method Design pattern in REST? I am trying to separate common functions across the endpoints into a template method, so the framework is handling some of these. I could not figure out a way to do it. Any ideas?

Have a look at RESTCommand.java from a blog entry discussing Android RESTful pattern .

I'm pretty sure execute() is a template method (although not the greatest example since it's only calling a single abstract method that's overridden in subclasses). Note that this is likely also the Command pattern.

带有模板方法的RESTCommand体系结构

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM