Show object creation (from DAL) in UML sequence chart - uml

I have 3 classes: Controller, DAL and Entity. The controller calls the DAL requesting an Entity. The DAL retrieves the entity data from the DB and creates a new Entity class which is then returned to the Controller. How do I show this on a UML sequece chart (no need to show the DB)?
2nd question: how should we share UML diagrams on SO? :)
Thanks in advance

Controller DAL DB
| | |
| get entity | |
|----------->| get entity data |
| |---------------->|
| |< - - - - - - - -|
| | |
| |-- |
| | |create entity |
| |<- |
|<- - - - - -| |
note: "Create entity" is a "self-message", so it starts from DAL's lifeline and goes back into DAL's lifeline. I just can't draw it better with characters. Forward messages are continous line, reply messages are dashed line.
EDIT: reflecting on comment, you can also show Entity's lifeline, if it's important.
Controller DAL DB
| | |
| get entity | |
|----------->| get entity data |
| |---------------->|
| |< - - - - - - - -|
| | |
| entity |---->Entity |
|<- - - - - -| | |
| | | |
It's useful if you want to show other calls to Entity as well.

Related

Data help and tips

I tried to make a calender visual, like here in the forum that I posted. Unfortunatelly I don't see an other option than Restructuring my data.
My currently data is as following
Project ID | Start Phase | Planning Phase | Execution Phase | Monitor Phase | live
22193 | 18-01-2021 | 20-01-2021 | 28-01-2021 | 20-02-2021 | 03-03-2021
29193 | 20-01-2021 | 10-02-2021 | 15-02-2021 | 19-03-2021 |
87596 | 25-02-2021 | 10-03-2021 | 25-03-2021 | 30-03-2021 | 10-04-2021
And I think my restructured data will be as followed.
Phase ID | Project ID | Phase | |Start | | End |
1 | 22193 | Start | |18-1-2021| |20-1-2021
2 | 22193 | Planning| |20-1-2021| |28-1-2021
3 | 22193 | Execition| |28-1-2021| |20-2-2021
4 | 22193 | Monitor | |20-2-2021| |03-03-202
5 | 22193 | Live | | | |03-03-2021
My question is: Is there a way to add phases in my data with every Project ID in Power BI (Dax, M Or tables?). Because doing it manualy whill take for ever.
And a sidequestion, will this restructuing my data affecy my sql database?
Edit:
The top structure did not meet my needs because I want to make a calendar visual in Power BI. Unfortunatey there is no visual which accepts multiple dates, The current visuals in Power Bi only accepts 1 start and 1 end date. That is the reason to restructure my data to be able to have 1 start and 1 end date
yours faithfully

How to conditionally query tables based on oData request in an Azure Logic App

I am a total newbie when it comes to both oData and Logic Apps.
My scenario is as follows:
I have an Azure SQL database with two tables (daily_stats, weekly_stats) for users
I have a Logic App I managed to test successfully but that targets one table, triggered by an HTTP request and initialises a variable using the following expression to get the query
if(equals(coalesce(trigger()['outputs']?['queries']?['filter'],''),''),'1 eq 1',trigger()['outputs']?['queries']?['filter'])
The problem comes with how to query a different table based on what the user passes as an ODATA GET request
I imagine I need a condition and the pseudo code of this would be something like:
For daily stats the ODATA query URL would be
https://myproject.logic.azure.com/workflows/some-guid-here/triggers/manual/paths/invoke/daily_stats/api-version=2016-10-01/&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=my-key-here&filter=userid eq 'richard'
For weekly stats the ODATA query URL would be
https://myproject.logic.azure.com/workflows/some-guid-here/triggers/manual/paths/invoke/weekly_stats/api-version=2016-10-01/&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=my-sig-here&filter=userid eq 'richard'
If it is daily_stats, it queries the daily_stats stored procedure/table for the user = richard
If it is weekly_stats, it queries the weekly_stats stored procedure/table for the user = richard
Edit: Added an ASCII flow diagram
+----------------------+
| HTTP ODATA GET |
| Reguest |
| |
+----------+-----------+
|
|
|
|
v
+-------+---------+
| |
| |
| |
| filter has |
| daily_stats |
| |
+-------+---------+
|
|
|
|
+-------------+ | +--------------+
| | | | |
| | YES | NO | |
| query +<--------------+-----------------+ query |
| daily | | monthly |
| stats | | stats |
| table | | table |
| | | |
+-------------+ +--------------+
There is a switch action, further more information you could refer to here:Create switch statements that run workflow actions based on specific values in Azure Logic Apps.
Below is my sample, switch statements support only equality operators. If you need other relational operators, such as "greater than", use a conditional statement.

Cucumber: nested scenario outline cycles

Scenario to automate:
Given <precondition> was fulfilled
And <user> is authorized
When user requests <endpoint>
Then user should receive <code> response
Test data matrix:
| precondition | endpoint | user1 | user 2 | ....
| | /users | OK | Not Found |
| | /roles | OK | OK |
| | /create_user | OK | OK |
| object user exists | /update_user | OK | OK |
| object user exists | /delete_user | OK | OK |
| | /create_data_role | OK | Not Found |
| data role exists | /update_data_role | OK | Not Found |
....
There's around 20 users with different role combination and around 20 endpoints.
Need to verify each endpoint for each user - so it should be a nested cycle.
How do I do it?
Don't do this in Cucumber - reasons
1) You get no benefit from putting all these routes and conditions in Gherkin. Nobody can read them and make sense of them especially if you trying something combinatorial
2) Cuke scenarios run slowly, and you want to run lots of them, you could dramatically reduce your run time by writing a fast unit test instead.
3) If you write this test in code you can write it much more elegantly than you can in Gherkin.
4) Dealing with errors is painful (as you've already pointed out)
You are using the wrong tool for this particular job, use something else.
Yet I come up with this option, but it doesn't follow gherkin convention because When and Then steps a jammed in one
1. Preconditions moved to #Before hook
2. Scenario
Given <user> is authorized
Then <user> requests functionality appropriate response code should be received
| ENDPOINT | USER1 | USER2|
| /users | 200 | 404 |
| /create_user | 200 | 404 |
| /update_user | 200 | 404 |
Examples:
| username |
| USER1 |
| USER2 |
It's also inconvenient because when tests failed it takes time to identify faulty endpoint(S)

Waterline.js Joins/Populate with existing database

I have an existing postgres database which I am using to build a sails.js driven website, utilising waterline for ORM.
I'm fine with using my database in its existing form for everything other than population i.e. joining tables.
When working with a non-production database I'm comfortable with how waterline can produce join tables for me, but I'm really unsure how to bypass this to work with the current tables I have and their foreign key relationships. To give an idea of the types of tables I would typically have I've shown an example below:
| Intel | |
|-------------|--------|
| Column | Type |
| id | int PK |
| alliance_id | int FK |
| planet_id | int FK |
| dist | int |
| bg | string |
| amps | int |
| Alliance | |
|----------|--------|
| Column | Type |
| id | int PK |
| name | string |
| score | int |
| value | int |
| size | int |
| Planet | |
|-----------|--------|
| Column | Type |
| id | int PK |
| rulerName | string |
| score | int |
| value | int |
| size | int |
So in the above tables I would typically be able to join Intel --> Alliance and Intel --> Planet and access the data across each of these.
What would I need in my waterline model of Intel, Alliance, Planet to access this easily?
I'd love to do a:
Intel.find({alliance.name= 'test'})
or
Intel.find().populate('planet')
and then somehow be able to access intel.planet.score or intel.alliance.name etc
Thanks for any help. I can add more information if required just let me know in the comments.
first create models for all your databases table , as mention here
you can populate models and return joins results

Doxygen: Class diagram (grey box) without collaboration diagrams

I want to create the image for a class diagram (UML styled), without the collaboration data.
I already have Doxywizard, but don't see how to do it without the collaboration relations.
What combination of options should I use?
This is ASCII representation of what I want:
----------
| Foo |
----------
| -bar1 |
| -bar2 |
----------
| +Foo() |
| +~Foo()|
----------
This is what I get currently:
---------- -----------------
| Foo | | OtherClass |
---------- -----------------
| -bar1 | | -test1 |
| -bar2 | | -test2 |
---------- -----> -----------------
| +Foo() | | +OtherClass() |
| +~Foo()| | +~OtherClass()|
---------- -----------------
Did you try setting COLLABORATION_GRAPH to NO?
COLLABORATION_GRAPH If the COLLABORATION_GRAPH and HAVE_DOT tags are
set to YES then doxygen will generate a graph for each documented
class showing the direct and indirect implementation dependencies
(inheritance, containment, and class references variables) of the
class with other documented classes.

Resources