How to make a depending relation between a class and a component in Enterprise Architect - enterprise-architect

I'm updating the existing documentation of a project I've done. In short, I have to add a new library to communicate the application with a new hardware the client wants to use. So far so good.
So in EA I went to the existing diagram and added a new component. I have a class that acts as controller for the actions this new hardware is going to do, so in the new implementation of the system, this class depends on the new component.
I tried to create a new dependency relationship between them, but when I release the mouse, a popup appears telling me that the connector used between origin and destination elements is not permitted. It prompts me with valid relationships between a class and a component. In that list I can see the dependency relationship, which is the one I'm trying to set up.
This is the popup:
Any ideas of what am I doing wrong?
Thank you in advance.

To me, it looks like some other Model validation is in place. What MDG Technologies do you have enabled? Which Toolbox / diagram are you using.
Go to Settings -> MDG Technologies and try to unselect the ones that are not standard with EA and try again, it must work.
PS - Works fine for me.

Related

Delphi: How to structure multi-device application with native controls?

or "How to decouple UI from business logic in Delphi?"
Each target platform has its own set of native firemonkey controls (Windows=VCL, MacOS=TMS mCL, Android=D.P.F, iOS=TMS iCL and D.P.F). The new FireUI (multi-device form designer) is a great solution for styled components, but not for native components because it still requires the same component on the master pane to support all platforms. As you cannot mix them on the same form, it completely breaks the whole idea with Delphi.
A lot of developers would say that Delphi is the broken approach, see "Why FireMonkey is so fundamentally wrong in every aspect". However, the premise for this question is NOT to argue against Delphi, but to get the best results out of what it does offer.
The conclusion is then that for each form in your application you have to make a separate form for each target platform. This leads to these questions:
Challenge 1: How to include different form files in your project depending on your target platform?
Solution 1: include all of them, i.e. MainForm_IOS.pas, MainForm_Android.pas, MainForm_Win, MainForm_OSX.pas, and then use compiler directives inside the files, so only the content of one of the files is active. Disadvantage: a large application can have many forms (we have around 40), so we are talking about a large number of included files.
Solution 2: Do not include them in the project, but instead just place them in seperate folders. Then you can add the matching folder to the search path for each target platform. Disadvantage: They will not show up in the Project Manager, so it will slow down the workflow every time you need to find a file.
Solution 3: Create a project for each target platform. Disadvantage: Every time you add new units or change common project settings you have to (remember to) apply it to all projects.
Update: As suggested in the Malcom Groves video, placing all the business logic in a package will remove the disadvantage from Solution 3. So I consider solution 3 as the best approach.
Challenge 2: How to connect the different device forms to the (same) business logic?
Possible solution: Create a "Helper" class that contains all the code you would normally have in the form unit.
Update: This "Helper class" is actually what the MVVM calls a ViewModel. What I need seem to be a MVVM framework that can support the databinding. I have made another question about that.
Any input and suggestions about best practice are welcome.
For challenge 1:
You can conditionally link in your FireMonkey form resources depending on the compile target:
{$R *.Windows.fmx MSWINDOWS}
{$R *.Macintosh.fmx _MACOS}
etc.
This is excatly what the XE7 Multiview designer does, but I see nothing against using this mechanism to link whole form files conditionally in to your executable. Of course you might also want to ifdef the corresponding units in your project file.
For challenge 2: Just use some form of Model View Controler logic. So your platform dependant forms will talk to a platform independant controler.

Papyrus: Hide/remove base_Class property from stereotypes

Is there a way to hide or remove the various base_Class properties that appear together with the properties defined for a stereotype? I am close to deploy a profile and I am pretty sure this will generate some confusion among the users.
Actually you really don't want to remove the 'base_*' properties as these indicate the meta class that your stereotypes extend. When a user goes to apply your profile, the meta class extension allows the UML editor e.g. Papyrus to display appropriate stereotypes for the target UML element. So if a user wants to apply your profile to a UML Class element, without the 'base_Class' property, nothing will show up. These extensions are linked to other elements within your profile so just removing them will cause your profile to "break" elsewhere. Other typical meta class extensions might be Property i.e. a 'base_Property' will show up. There are many others.
Oh ok cool. So when your users apply the profile to a model this takes place, as you know, primarily under the Profile->Applied stereotypes area of the Properties editor. The meta class extension properties are definitely not visible there, at least on my Papyrus version. Using Modeling Luna 4.4.0

Is my thinking about mvvm right?

I'm having a little bit of a hard time getting into mvvm. I'm writing a simple app, Notebook. I have one viewmodel, it's name is actually ViewModel. It has an ObservableCollection of Notes inside and methods to save and load those from Isolated Storage. My only Model is Note.cs, it implements INotifyPropertyChanged and I'm of course RaisingPropertyChanged.
I've also got two view, both of them are user controls. One to display list of notes and one to edit the one chosen from the list.
My questions are:
Where do I create an instance of my vievmodel?
How should I implement going from the page with list of notes to the page with detailed view after choosing one Note to edit? At the
moment I'm saving the index of Note in App.xaml.cs, going to the next page and setting
the DetailedView DataContext to the right Note in OnNavigatedTo, but
I don't think it's actually the perfect solution.
Where should I save my Notes? I guess Application_Closing in App.xaml.cs is the right place to do it, but I'd have to have my viewmodel as a global object there, is this the right approach?
Additional question:
I have to add possibility to group notes. I guess that class Group with dictionary (GroupName, howManyNotes) is going to be allright since I don't have to be able to for example write all notes from selected group. Do you think there's a better approach I should think about?
Thanks for respones,
MichaƂ.
I would suggest you take a look at Calibrun.Micro which is a great framework for MVVM. You can get some sample from the CodePlex.
I have used that in a bunch of Project, and will give you flexibility in case if your project grows in size.
Google for Caliburn.Micro sample and you will find a number of sample for all technologies like WPF, Silverlight, Windows Store, Windows Mobile.
Caliburn.Micro CodePlex

Reverse engineering in Bouml for php project

My php project using Zend framework. i want to generate class diagram for that php(zendframwork). i try to generate class diagram using Bouml project.
I go through this link Boumal java reverse engineering video
but problem is when i drag and drop every php class but that don't show relationship between class
You could give UML Lab (http://uml-lab.com) a try (Note: I'm biased as I'm working for Yatta Solutions ;) ). There is a tutorial explaining how to reverse engineer existing source code: http://www.uml-lab.com/en/uml-lab/tutorials/reverse-engineering-tutorial/. Basically, just create a new Model and Class Diagram and all available PHP source files are imported automatically. Otherwise you can import a PHP file by dragging it onto the diagram editor.
The tool supports Java and PHP, and has build-in support for Zend Framework. It may not understand each PHP source file - but files containing a class should work fine. If there is something the tool doesn't understand you'll be notified and can directly file a bug.
It's a commercial tool, but there is a 30 days trial and a free academic edition. If you have any questions don't hesitate asking them in the forum, bug tracker or by mail.
each time you add a class in a class diagram the relations with the already present classes are shown, except of course if you modified the "drawing settings" to not draw automatically the relations.
but this supposes there are relations to draw ;-)
Php is a not typed language, so the reverse can only create inheritances, the types of the attributes are unknown contrarily to C++ or Java

How to combine Eclipse Databinding and UndoableOperations?

in my RCP - Project i'm using eclipse databinding to connect the ui with the backend. I want every change in an open editor to be undoable. My Domainmodell and UI are seperated in two different plugins.
My current approach is to implement my own UpdateValueStrategy class for the databinding. I extend the normal UpdateValueStrategy and override the doSet Methode.
From there i get the OperationHistory and the Global UndoContext, then i create a new Operation. I have various Operations like "ChangeCustomerName" and "ChangeCustomerNote".
Questions:
Do i need to implement the undo/redo - logic by my own, or is the framework somehow supporting my with this?
Is there a better place or way to create the undoable Operation then the doSet() of the UpdateValue - Strategy class. To access the textfield, which was changed is not to easy.
The answer you will get mostly is: Use EMF.Edit, it includes it out of the box with org.eclipse.emf.databinding.edit and there's an excellent tutorial on the net.
There is an open feature request in the Eclipse bugtracker about including undo/redo also in JFace databinding without EMF but it's not finished yet. It has also be discussed in the eclipse forum.