开发者

MCV/MVP Patterns and Applications that interface with Hardware (DAQ/PLC/etc)

I've been reading a lot about the MCV and MVP patterns for use with UI and it seems like a really nice powerful way to handle user interfaces. I am - however - having a difficult time deciding how this could integrate into a system where data in the model is created from a Data Acquisition System or Serial/Ethernet devices. There is also the added step that 开发者_运维百科70% of application interaction is performed by a PLC instead of a live user.

It seems that for apps that just read/write & manipulate information from a database this works great, but how does does hardware and automation fit into these patterns? Is it as simple as another controller (for lack of a better term) that interacts with hardware that manipulates data and writes to a model?

Maybe I am over thinking this or thinking too simply, so any advice would be great. I'm not quite sure where I'm going with this, so if something doesn't make sense or I was too vague leave me a comment.

Thanks!


The hardware state is your model. How it gets updated is not part of the pattern, only how an update to the state affects your view.


Just adding to what Hans said - Your data acquisition feeds into the data model of your application.

(Using the MVVM/WPF/Silverlight context) This in turn should raise the NotifyPropertyChanged event on your ViewModel (aka Presentation Model), which then propagates through to your view automatically via databinding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜