3

We are evaluating one design for educational activity. We would like to create complete backend (which handles business logic) in form of RESTful web services.

These services can be used by various apps. Is it good idea to call these web services from Struts 2 framework? I read couple of docs, and people discourage it.

We would love to go with Struts 2 as team is quite strong on it. But if its bad approach, we may consider for other options.

Roman C
  • 49,761
  • 33
  • 66
  • 176
navaltiger
  • 884
  • 12
  • 27
  • 1
    What exactly do you think is bad approach? Maybe share links to that docs you are mentioning. – Aleksandr M Oct 10 '14 at 13:35
  • 1
    +1, this is an interesting topic (even if in a bad shaped question). Many collegues of mine are starting developing apps in a stack with Restful webservices only on server, and Angularjs only on client. A mixed approach has not been attempted yet... I guess there is nothing wrong in using MVC the Struts2 way and adding restful webservices to the stack, it's just not immediate to figure out which kind of stuff delegate to the actions and which other to the services. Keep us up to date. – Andrea Ligios Oct 10 '14 at 14:27
  • http://www.slideshare.net/mrdon/an-introduction-to-struts-2-and-restful-applications-presentation?next_slideshow=2 Few others. – navaltiger Oct 10 '14 at 15:48
  • I've done a few mixed apps where the underlying site structure is action-based, but pages themselves are either all or partially client framework based. It works fine. – Dave Newton Oct 10 '14 at 15:59
  • Slides are about turning S2 application **into** restful form. Not about calling some rest service **from** S2 application. – Aleksandr M Oct 10 '14 at 17:58

1 Answers1

0

If you want to leverage development on presentation layer between client-side and server-side (this is where Struts2) then you can utilize web services using a web services client API. At this point these web services can be used as data resources.

If you want to stay only on client-side then you don't need any server-side framework for the frontend development.

Note that The introduction to Struts2 and RESTful applications you have posted in comment introduces an alternative way instead of web services for creating backend in a form of RESTful API using Struts2 framework.

Using Struts2 for the REST instead of web services could be a solution for RAD (Rapid Application Development). Because web services are very complicated technology that used in upper high level architectures and using some alternative resource APIs might be cost effective.

Roman C
  • 49,761
  • 33
  • 66
  • 176