design – is MVC an architectural model for interactive applications only?

Is it true that MVC is an architectural model only for interactive applications with the user? (This is my understanding)

Your understanding is correct.

Interactive with the machine applications unlike interactive for the user do not usually need to present views for the client API. Yet the controller and the model part are useful to be wrapped up and exposed with an appropriate API.

Probably the Facade or Bridge should become a choice in such a situation.

The main difference is that it is not necessary to make a view of the underlying model as a result of a request or an action. Machine interfaces can interact more efficiently depending on certain protocols.

Is the use of the Observer model a good idea when building a game of chess?

I'm trying to design a game of chess using OOP concepts that have an element of user interface. My idea is to show the number of squares / cells in which a room can travel when it is selected. Basically, I want to show the paths / directions in which he can travel / attack in a different color.

Something like the following

(enter the description of the image here)

I have therefore designed a summary Piece class, which, among others, has a Map object that keeps track of all the cells to which it can move in the sense of direction, something like that
Map>

Now, let's say that a piece of the Queen's own team comes in his way to attack in the FORWARD direction and gets on the cell that is at chessBoard(6)(4)

What better way can I inform the Queen or any other piece looking at this particular cell of the event so that each piece can call its own method of updating and redraw its path of attack?

I was thinking of going with the Observer model where each cell will be a subject and only the pieces that will watch them will be observers. So, in any case, something happens in one of the cells monitored by a particular set of pieces, only those pieces will be notified.

But then I do not know if it's a good approach because I have to have a maximum of 32 listeners for each cell. I do not know if it will be scalable.

Are there better ways to do it?

Thank you for taking the time to read.

I will make a product video ad for social media for $ 15

I will make a product video ad for social media

Important: Before you send me an offer, send me a message please.
If I have to show your product, I must first receive it.

Hello.
I would be happy to make a special video for you.
I can show your product in my 10s-60s video.
If you have a special idea, share it with me.
We can make video with your own idea.
-Alicja

How to replace vendor magento module-fedex Model Carrier.php?

I want to make changes to vendor magento module-fedex Model Carrier.php
How to replace this main file? I just want this waiver to be complete. Like which folder I have to create and which files I have to create, and which Magento command I have to execute after all the files have been created. Thank you

partial derivative – How to derive Dupire's local volatility model?

I want to calculate the local volatility of Dupire, but I have been fighting for several days.
Here is the formula for obtaining the local variance, with $ y = ln left ( frac {K} {F} right) $ and $ w = sigma_ {BS} ^ 2 , T $and I receive $ sigma_ {BS} $ of $ tilde {BS} ^ {- 1} $ :
$ v_ {l} = frac { frac { partial w} { partial T}} { left (1 – frac {y} {w} frac { partial w} { partial y} + frac {1} {2} frac { partial ^ 2 w} { partial y ^ 2} + frac {1} {4} left (- frac {1} {4} + frac {1} {w} + frac {y ^ 2} {w ^ 2} right) left ( frac { partial w} { partial y} right) ^ 2 right)} $

Sorry for the stupid question, but I have different strikes for the same maturity, so I have to calculate $ frac { partial w} { partial T} $ doing $ frac {w_ {2} -w_ {1}} {T_1-T_2} $ for the first while knowing that I must also calculate $ frac { partial w} { partial y} $ and then should I take the $ y $ of the different period too? Or should I take a more or less arbitrary $ h $ and calculate $ frac {w_ {T + h} -w_ {T}} {h} $ and do the same thing with $ y $ ?

Thanks for the help.

is this php smarty model statement a security breach?

$smarty->assign("action", $_SERVER("PHP_SELF"));

PHP_SELF is placed on the client side by the browser and can be modified by an attacker.
Is Smarty "action" assigned to the form's action field?
So, the attacker can control where to send the later data and maybe see the variables set on the server?

Any other defects with this statement?

How to divide the list according to the model?

There is a list of lists:

{{0,0,0}, {0,0,1}, {0,1,0}, {0,1,1}, {1,0,0}, {1,0,1}, {1,1,0}, {1,1,1}}

I need to redefine its elements according to a scheme: "if the first and third elements are identical, create a partition". I therefore need to get the following result:

{{{0,0,0},{0,1,0}}, {{0,0,1},{0,1,1}}, {{1,0,0},{1,1,0}}, {{1,0,1},{1,1,1}}}

How can I do it in Mathematica?

How is it possible to model in a database many different products?

For example, a smartphone may have attributes such as RAM and camera resolution, while a refrigerator has very different attributes. Is there a way to store this data in a relational database?

architecture – Reception, processing and sending, which model to use in microservice

I started creating a microservice with Spring Boot 2.2.
Another microservice sends me a message via JMS.
You have to take the message, convert it to Ojbect, do a basic calculation, save the received data and the result of the calculation. and send it to another microservice.
We expect to create a class that will be called in the received message class and perform all these operations. A kind of facade.
It's a very easy structure.

Is there a good model to use instead of facade to do this job.

c # – Which template mapper in a service for repository model

I have a doubt about the repository model and the service layer.

For See the layer I have a controller that creates an interface from ViewModels DTO (View) and my EntityModels (DataLayer). It is properly separated and the controller / service works with models that correctly use mappers.

Example:

//Model DTO
class LoginRequestDTO {
   public Username { get; set; }
   public Password { get; set; }
}

//Entity Model
class LoggedUserEntity {
   public ID { get; set; }
   public Username { get; set; }
}

For service / repository I wonder if the service method should take an entity model (data layer) as an argument or another model (from my business layer), and then map BusinessModel to EntityModel.

Example:

//Model DTO (came from another lib)
class User {
   public Name { get; set; }
   public OptionalValue { get; set; }
}

//Entity Model
class UserEntity {
   public ID { get; set; }
   public Username { get; set; }
   public GenericParameter { get; set; }
}

What should I do correctly?

Solution 1

Utility.cs
void execRoutine() {
    User user = someRoutineInAnotherLibs.getUser();
    var mappedUserEntity = Mapper.convertUserToUserEntity(user);
    serviceUser.saveUser(mappedUserEntity);
}


ServiceUser.cs
void saveUser(UserEntity u) {
    repo.insert(u);
}

Solution 2

Utility.cs
void execRoutine() {
    User user = someRoutineInAnotherLibs.getUser();
    serviceUser.saveUser(user);
}


ServiceUser.cs
void saveUser(User u) {
    var mappedUserEntity = Mapper.convertUserToUserEntity(user);
    repo.insert(u);
}

In Solution 1, I should provide UserEntity to Service and insert a service insert directly into the database.

In Solution 2, I should provide a user to the service, which converts a template to another template, and then inserts it into the database.

In each case, I do not need to know the implementation of User or UserEntity, because I have a mapper who knows how to map one model to another, so I think I do not violate the SRP.