Layers in MVVM
How many layers in MVVM project and what we put in each layer ?
Do we have Poco also ?
Three layers
Model (Data base)
View-Model (Methodes proprites commands )
View the UI without a behind code all code is in View Model
This MSDN paper on MVVM should answer your question with regard to the logical layering of an MVVM solution. Pocos may exist depending upon your Model complexity.
http://msdn.microsoft.com/en-us/library/gg405484%28v=pandp.40%29.aspx
Related
I'm trying to develop a PRISM WPF application where I am going to have two or more views depending on the same ViewModel. At first I thought of using Unity to do an injection through the view's constructor and within the constructor set the DataContext. That idea was dismissed by the team because they want nothing in the code-behind. Moreover, the views are using a ViewModelLocator that is Autowired to the ViewModel. So then my only other thought doing a Module with a single view, but then how do I go about sharing the same ViewModel between modules if I'm using Unity IOC? Any ideas with some kind of example?
Don't share ViewModels instances between views. Just load data as you need it. But if you must shoot yourself in the foot there are many ways to do it. The easiest would be to register your ViewModel as a singleton in your container.
I wonder if there is a framework or class for creating a train scedule similar to the below screenshot. Of course I know, I can create the table cells myself, but probably there is already a framework available.
Many thanks in advance.
To answer my own question: I finally did it by creating a custom table cell and drawing rectangles and lines for visualizing the route.
I'm using Agilian 3.2 to build a small activity diagram. The diagram contains a couple of actions. The problem is: I'd like to display the precondition somewhere in the diagram. Is there any standard way to define preconditions for an action or activity diagram in Agilian?
Usually you add a kind of pink rectangle which is a kind of note which is related to constraints. These constrains could be added on any model element. I don't know about this Agilian 3.2 tool but it should certainly be possible.
Tis is a basic modeling feature including in almost all good tools.
I am new to iOS platform and i heard about MVC archtecture.
To draw a circle i just create a separate UIView class and override the drawRect: and able to do this.
But now i want to rebuild the same project using MVC architecture.The main aim is to separate my Model part from View & Controller part.So that i can extend my project.
So how can i do this?
Any sample application for reference?
I'm not sure what you want to separate. Drawing a circle would generally fit into the "View" part of the MVC architecture, which is what you have already done. Code that would, for instance, change the colour of the circle would live in the "Controller" part, which on iOS is a UIViewController. If you had something storing information on what the circle looked like (i.e. size, colour, etc.), that could be considered part of the model, and can be stored in its own class, pulled in by the view controller and passed to the view when it is neede.
Here is a link that may help.
http://www.bit-101.com/blog/?p=1969
As for the model side of things, Core Data is a technology that can help.
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html#//apple_ref/doc/uid/TP40001075
The separation would be the drawing code in drawRect and the size and location in a model with a controller getting the circle attributes from the model and requesting the drawing and passing the attributes to the view. The model might be another class or an API supplied class such as an NSDictionary.
By creating a separate model if there were multiple circles the controller could make multiple draw requests, one per model circle. Or there could be multiple views that the circle(s) would be drawn in or different representations such as a text list of the circles attributed in one view and graphic circles in another.
Many patterns seem trivial and not particularly useful in the trivial case yet in a real-world program work very well.
I'm using a set of views for the data access layer of our primary web application, and need to document these views. Logically the views mirror the underlying tables, meaning they have similar relationships to the tables. (It's a bit more complex, since the views are pulling data from 3 databases...)
So I opened up Visio and reverse engineered the views in question into the diagram, but the problem now is that Visio won't let me add relationships to views.
Is there any way around that limitation so that I can model these views as if they were actually tables?
Or is there an easy way to "convert" each view to a table? (I could do it manually, but that's a lot of boring typing for all the properties...)
Have you succeeded in this? I need to document data layer based on related views, but in addition to the problem related to relations there is another one: when model is refreshed the tables in the drawings update nicely but all chenged views disappear from the drawing. The model is updated, i.e. if I drag the views back on canvas the content is updated. But still I don't want to rebuild the whole picture every time a small update is done on the DB...