Is creating ViewModels in the Web API a bad practice?

Someone at work who is twice as experienced as I was told us that can not create a ViewModel Classes within the Web API. (We use Angular for the user interface)

In his opinion, ViewModel ASP.NET MVC approach. And we have to stop it if we use the web api.

Here's my argument for using ViewModel in WebAPIs:

Database tables

Employee

name | phone | categoryId |...Col15

category

categoryId | Description

C # class

Class Employee
{
 public string name {get;set;}
 public phone {get;set;}
 public categoryId {get;set;}
 //...till col15
}

If you see only the following on your UI page:

 name | phone | categoryId | CategoryDescription

Would not it make sense to have one ViewModel Class in API that has only these 4 properties as opposed to all 15 properties?
The JSON returned by this class has only 4 properties instead of 15 properties, of which 11 contain null values.

If there is a list of, for example, 100 employees, this would mean 1100 empty json properties that are sent to the UI when the original Employee class is used instead of a ViewModel Class.

If we stick to our original employee class, we may need to do one of the following:

  1. CategoryDescription must be added to the original employee class
  2. Make a second API call from the UI to get the description.

etl – Best Practice for Sharing Code and Data Between Airflow Worker Nodes?

New to Apache Airflow and curious as to how code and data are likely to be used on worker nodes in a multinode airflow setup.

When I think about whether the ETL logic should be in the tags or in separate files called by operators in the tag, I see from here (https://www.astronomer.io/guides/dag-best- practices /):

Try treating the DAG file as a configuration file, leaving the hook and the operator to do all the lifting.

This raises the following question: 1) How can the operator code in a multi-node airflow configuration be best synchronized between employees? And 2) In a multinode configuration, is it expected that all workers provide shared drives to store intermediate data (or does airflow have another internal method of transferring data between workers to handle DAG tasks)?

Multiple Monitors – Best Practice Two Graphics Cards

I think about a second graphics card.
I own a 2080 RTX TI that I use to render 3D content and games.

When I render a huge 3D scene that lasts several hours, the computer is bought and of course it is not possible to play games while the scene is being rendered.

So I thought about buying a second 2080RTX TI.
Then I can play games on a card and render with the other stuff.

Before I buy this expensive setup, I have to know two things:
1. Can you tell Windows which graphics card to use for a specific task? Use this graphics card for games and everything else.

  1. Is it important to which video card I connect my monitor?

Authorization – Best Practice: User Roles and Permissions with MSAL and Azure AD

I'm creating a mobile app (in Xamarin.Forms) that MSAL uses to authenticate the user against Azure AD. My background is more the IT infrastructure. My first thought was to use the existing Active Directory groups (which are synced with Azure AD) to assign permissions in the app.

But one day, the app should support different Azure AD tenants.

Do you see any obvious pitfalls that I miss?

Is there a better way I do not know?

If someone could point me to a tutorial or example from which I could start the research.

Hope this is not a vague question.

Thank you very much

android – Best practice for tagging features in mobile apps while avoiding incomplete features?

I wonder how best to handle the scenario in which a mobile app is published that has an incomplete function behind a feature flag in one version and then the full function behind the flag in a subsequent release. t encounter incomplete functionality.

Let's say I'm developing a feature called Weather for my iOS app. I publish an incomplete version of Weather Feature in the App Store in the version 1.1.0 – I put it behind a feature flag called show-weather and I've set that up false in the backend. I will release then version 2.0.0 from my app that did that Weather Feature and Flip show-weather to true in the backend. Oh oh! Users with 1.1.0 Still installed now see an incomplete version of the Weather Feature.

Ideas for mitigation:

  • The app sends its version number to the backend when feature flags are retrieved and sends the backend false if the app version is too low
  • The app implementation mocks the response of the feature flag service in the release 1.1.0 hand back false and replaces the mock with a true backend integration with the release 2.0.0
  • Users are forced to update the app once a featured feature is completed
  • Developers do not merge incomplete features – feature flags are only used to change the appearance of fully realized features

The last two options do not seem to be optimal. We do not want to put users into JAR mode often. and we do not want developers having to maintain long-term offices.

The first 2 might work, but it seems like something on the backend or frontend could easily be forgotten.

What is an optimal solution for this scenario?