How to represent implementing Interface in Activity Diagram - android-activity

I am beginner in UML and now I am creating one activity diagram to represent interfaces . How can I draw for implementing Interface in activity diagram.

An interface will appear as activity parameter like so:
The parameter to the left is typed with the interface. It can send/receive objects which are defined by the interface via object flow to action(-pin)s inside the activity. That's basically all you need.
Note that I show the interface only for illustration. There is usually no need to include it along with the activity on your AD.

Related

Implement an interface that is exposed by a component in a class inside the component and show it in the corresponding class model

I have a Component in a component diagram that provides several interfaces. Now i'd like a class in a class diagram that describes this component to implement this interface.
What i tried:
Drag the interface into the class model --> results in the message 'When dropping embedded elements to a diagram, you must drop them on theit correct owner.'
Creating the interface in the class model, then trying to link it with the interface in the component model --> I didn't find a way to accomplish that.
Adding the class to the component model and add a realization to the exposed interface. This results in pretty arrows, but the class is in the component model. If I remove it from the model, the interfaces are still in the linked element list of the class, but i have found no way to add the interfaces to the model then, neither show in another way that this class implements those interfaces.
Any proposals how to accomplish that?
The second way DOES work. I now found the [...] button beside the textfield where to enter the name of the interface. It is possible to add an existing interface there.

WF4.0: Workflow designer for a Custom Code Activity - Is MVVM a good idea?

By default ActivityDesigner set its DataContext to "this" (the ActivityDesigner itself). The ModelItem type and is available through the ModelItem property and represents the Activity you are doing a designer for.
Would it be a good idea to use MVVM for ActivityDesigner ? I don't think so but I couldn't find any article on it.
Your Activity is your ViewModel. And the ModelItem is where you mix in what does not exist within the Activity.
The ModelItem wraps your ViewModel to provide for all the UI facilities that do not need to exist within the Activity itself, such as undo/redo and change notification.
It also, and possibly more importantly, provides for attached properties which you can use to mix into your Activity ViewModel-ish facilities that do not and should not exist within your Activity.

Repeated interfaces in component diagrams

When modelling component diagrams in UML2, is it permissable to repeat an interface on a component if it makes it easier to connect components? Such as below:
Any guidance would be most helpful. Thanks.
Any block that you see on the UML diagram, is merely a view of an object, that can have many views. How you are placing and cloning them is up to your convenience.
Only when creating new interfaces of the same name, be sure that you are creating new views of the same object (interface in your case). If you'll simply copypast your interface'in VP UML, you'll simply clone it.
What is interesting, later, on the class diagram you will have interfaces shown as special class blocks, not as here. And these will be also merely other views of the same interfaces you see now on your component diagram. At least, it is a good style to do it so.
So, yes, you can. It is the default behaviour.

How do I implement base view functionality on Windows Phone 7?

Lets say that on all my views, or generally at any time in my app, I want to be able to show an error message popup, and it always looks the same. How do I do that?
First thought is having all my view models extend a base view model which facilitates these things, but after that, do I have this base view model actually create the UI widgets and display them?
thanks,
Mark
If you've got some common functionality that you want to provide across a range of views, then you can implement a base class that inherits from the PhoneApplicationPage, and then derive all your classes from that class instead. The XAML for your pages then looks like this:
<local:BasePage xmlns ...
xmlns:local="clr-namespace:MyNamespace"
x:Class="MyNamespace.MyPage">
However, you will not be able to define common UI components in the XAML for your base page. If you wanted to have common UI components you would have create them manually in the code-behind for the base page, perhaps in a handler for the Loaded event, but I think a better solution would be to provide your common UI in a UserControl, which you then add to each of your pages.
If you want to show a Toast or Message Box, then I would recommend the ToastRequestTrigger and MessageBoxRequestTrigger from the Silverlight Toolkit as described in the patterns & practices WP7 Developer Guide.
you could probably define an event on base view model, which is fired inside view model whenever an error occurs, then in view, you can subscribe to this event and display the popup. You can carry error context in EventArgs of the fired event.
Additionally you could unify the logic for displaying the popup but that's probably another story :)
This is testable and nicely decoupled from the view.
Hope this helps,
Robert

While using CellTree where to implement TreeViewModel (View / Presenter)

I am trying to use CellTree, i am confused about placement of class implementing TreeViewModel, This class will need Collection of elements required to be rendered as tree if this is view type class i need to push collection from the presenter. If its a Presenter class i can directly call the server function and get the collection.
I am finding it more near to Presenter.... please sugget
According to GWT docs,
A key concept of MVP development is
that a view is defined by an
interface. This allows multiple view
implementations based on client
characteristics (such as mobile vs.
desktop)
So, looks like Presenter should know neither about data presentation widgets used in view implementation, nor about specific ViewModels and data providers used by these data presentation widgets (since data presentation widgets may be changed). ViewModels are generally coupled with particular way to implement data presentation, so I usually consider them as a part of View.
I usually create presenter methods like getObjectsList(params), which return array / list of required data, and then transform these results to ViewModel.
BTW, it would be great to hear other opinions :)