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:
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.