model view controller in grails with out database

2019-07-12 00:47发布

I don't have any experience with MVC, and am trying to use Grails to write a simple web app. All the examples I've found assume you have a database to base your domain classes off of, and there for have a model based on a database. I'm getting data through an API that does socket communication, and would want the model to be based on that Data. Are there any examples of using a source other then a database for the model component of an MVC app? I'd prefer the examples to be in Grails but will sue any web based examples I can get.

1条回答
劳资没心,怎么记你
2楼-- · 2019-07-12 01:13

Check out command objects. They're pretty much like domain objects as you can do neat things like validation on them, but they're not mapped to any database.

查看更多
登录 后发表回答