How to use AJAX in many layers?

0

I'm studying DDD I have an application with 4 layers being them

  • Presentation
  • Application
  • Domain
  • Infra

In the presentation layer I search data via Ajax in the DB, but I have a question as to how to do it. Do I need to make ajax go through all the layers? What I have noticed a loss of performance in the application ... If not, what is the best way to do it?

    
asked by anonymous 06.04.2016 / 20:41

1 answer

0

Most of the times it is not necessary, nor recommended to use this architecture with . On the contrary. Often you are just complicating a simple thing without need. This has already been commented here a few times, as in the questions / answers below:

But if you still want to continue with this structure, you should do it exactly that way.

The Ajax request will call an Action in its controller and it will pass the data to the other layers.

Regarding performance loss, it's probably not just the structure, but something in your code.

    
06.04.2016 / 21:29