Diferencia entre MVC y MVC2

Si hay algún problema en el desarrollo de software, entonces su patrón de diseño es la solución principal para solucionarlo. Son como planos predefinidos que utilizamos para resolver problemas de diseño orientados a objetos en su proyecto. En primer lugar, descubre dónde está el problema y luego lo soluciona y también describe el procedimiento y sus consecuencias. MVC y MVC2 son dos enfoques diferentes para el famoso patrón de arquitectura MVC ( Model View Controller ).

MVC vs MVC2

La principal diferencia entre MVC y MVC2 es que MVC es un modelo de diseño de aplicación compuesto por tres partes interconectadas, mientras que MVC2 es un patrón más complejo donde el desacoplamiento de la aplicación La lógica de control de estado y presentación está hecha. MVC incluye el modelo ( datos ), la vista ( interfaz de usuario ) y la solicitud de procesos del controlador ( ) . Una diferencia importante entre MVC y MVC2 es la complejidad. En aplicaciones web del mundo Java, los dos modelos de diseño comunes ( Modelo 1 y Modelo 2 ) están estrechamente relacionados con MVC y a menudo se denominan erróneamente MVC1 ( o simplemente MVC ) y MVC2.

MVC fue el enfoque de primera generación en aplicaciones web Java donde se usaron páginas JavaServer Page ( JSP ) para la interfaz de usuario junto con JavaBeans que podrían encapsular los múltiples objetos en un objeto único para implementar la arquitectura MVC. Las solicitudes de usuario del navegador se envían a JSP, que contiene la lógica del controlador y vincula el modelo para los datos que actualizarían la vista y enviarían la respuesta al usuario que obtiene mostrado en la interfaz de usuario. Este enfoque combina la funcionalidad Controlador y Vista dentro de una página JSP y, por lo tanto, rompe el paradigma MVC.

MVC2 fue introducido por Sun Microsystem org como un patrón de diseño que no rompe el paradigma MVC, a diferencia de MVC, donde la lógica empresarial se separó de las vistas y todas las solicitudes de los clientes se manejaron en un solo lugar en lugar de en cada archivo JSP en MVC. En el patrón MVC2, JSP se reemplaza por servlets para la lógica del controlador.

Te puede interesar:  Diferencia entre Mac y Windows

Tabla de comparación entre MVC y MVC2

Parámetro de comparación MVC <TAG1, Hay múltiples componentes para recibir solicitudes y enviar respuestas. es decir. Controlador y vista. Navegación En MVC, cada JSP tiene un controlador y una lógica de vista que determina la navegación de la siguiente página de vista que la hace redistribuida En MVC2, el servlet contiene la lógica de navegación de la siguiente página de vista que la hace centralizada Consumo de tiempo Toma más tiempo escribir el código para desarrollar las etiquetas JSP personalizadas para evitar scriptlet tagToma menos tiempo para desarrollarse ya que todo el control de navegación está centralizado. Independencia Lógica comercial y presentación La lógica se combina en JSP, para que los diseñadores web y los desarrolladores web no puedan trabajar simultáneamente, ya que tiene una separación entre la lógica y la vista, es por eso que el diseñador y el desarrollador pueden trabajar juntos. Reutilización Es más difícil de reutilizar y extender debido al acoplamiento estrecho entre lógica y vista Es fácil de reutilizar y extender, lo que es adecuado para aplicaciones más grandes

¿Qué es MVC?

MVC es un patrón de diseño arquitectónico para problemas recurrentes de diseño de software que proporciona un enfoque de descripción de alto nivel para la solución. La arquitectura MVC tiene tres módulos: modelo, vista y controlador.

Modelo: Representa el estado de los datos ( que se muestra al usuario en la página de vista ).

Ver: El módulo de vista es la interfaz de usuario a través de la cual el usuario realiza la acción y se comunica internamente con el servidor.

Controlador: El módulo controlador procesa la solicitud del usuario, la lógica empresarial y con la ayuda de un modelo manipula los datos que se muestran en la interfaz de usuario.

MVC comienza con JSP aceptando la solicitud del cliente que trabaja junto con JavaBeans para la lógica de procesamiento de datos que se envía al cliente. El trabajo se divide entre JavaBeans y JSP, donde JSP invoca los JavaBeans y la lógica empresarial en la que JavaBeans llama internamente a la base de datos para guardar / obtener los datos. Al final, JSP devuelve la respuesta al cliente que actualiza la vista en el navegador.

Te puede interesar:  Diferencia entre Microsoft M365 y O365

JavaBeans, que también se conocen como Beans, es responsable de la encapsulación de múltiples objetos en un solo objeto, mientras que el JSP tiene la lógica Controller y View. MVC también se conoce como centrado en la página debido a su acceso directo a otra página de vista que es ideal para aplicaciones más pequeñas.

¿Qué es MVC2?

La mayoría de los ingenieros de software piensan que MVC2 es una versión mejorada de MVC, como la versión 2.0; no lo es. El Modelo 1 y el Modelo 2 se desarrollaron simultáneamente y son dos variantes de cómo se deben hacer las cosas.

MVC2 es un patrón más complejo donde se realiza el desacoplamiento del estado de la aplicación y la lógica de control de presentación. Tiene un controlador en el que se ha escrito la lógica para procesar todas las solicitudes entrantes y las acciones requeridas que deben tomarse, como navegación a una página de vista diferente o actualización del estado del Modelo.

Aquí, en MVC2, el servlet actúa como la capa controladora, que también es una interfaz entre la capa Ver y la capa Modelo en la que recibe la solicitud del cliente o la interfaz de usuario, que no es más que una capa de vista, y los procesa con la validación adecuada si es necesario. JSP tiene una lógica de vista que utiliza internamente los frijoles, por lo que si los servlets actualizan el estado del modelo, se refleja en la página de vista.

A diferencia de MVC, JSP en MVC2 no tiene controladores ni lógica de vista; su única responsabilidad es recuperar el estado actualizado del modelo de ese servlet para mostrar en la página de vista.

Diferencias principales entre MVC y MVC2

A menudo confundimos MVC2 como la versión 2.0 de MVC, sin embargo, no lo son, son los modelos de diseño Java donde la arquitectura MVC2 es más compleja y más adecuada para las aplicaciones más grandes.

Te puede interesar:  Diferencia entre escritorio remoto y asistencia remota

El factor distintivo entre MVC y las relaciones MVC2 se puede resumir por los siguientes motivos:

  1. En MVC, un solo componente es responsable de recibir solicitudes y enviar respuestas, pero en MVC2, hay múltiples componentes para recibir solicitudes y enviar respuestas. es decir. Controlador y amplificador; Ver.
  2. MVC1 combina estrechamente la lógica de presentación con la lógica de negocios, pero MVC 2 aísla o desacopla la lógica de presentación de la lógica de negocios.
  3. En MVC La lógica de negocios y la presentación La lógica se combina en JSP, por lo tanto, los diseñadores web y los desarrolladores web no pueden trabajar simultáneamente, pero en MVC2 hay una separación entre la lógica y la vista, por eso el diseñador y el desarrollador pueden trabajar juntos.
  4. En MVC 1, controlador y modelo, ambos son JSP o podríamos decir escritos en el mismo JSP. Pero en MVC2 el controlador es servlet y el modelo es de clase Java.
  5. MVC No admite la reutilización de componentes de aplicación, mientras que MVC2 admite la reutilización de componentes que son buenos para aplicaciones más grandes y complejas.

Síntesis

Como vimos la gran diferencia de línea entre MVC y MVC2 a pesar de tener nombres similares, ambos se utilizan como soluciones para problemas recurrentes de diseño del sistema.

MVC2 es más complejo y tiene una separación de preocupaciones que se utiliza para aplicaciones más grandes o experiencia de usuario intuitiva debido a su característica centralizada donde todas las solicitudes son manejadas por un controlador. A diferencia del MVC donde el JSP actual es el que determina la siguiente página de vista para abrir.

MVC2 desacopla las páginas de vista de los controladores, a diferencia del MVC que mantiene la lógica comercial y de visión acoplada en un JSP. Por lo tanto, el MVC2 es más fácil de mantener para múltiples usuarios debido a su reutilización y función de extensión y es capaz de admitir un sistema más complicado en tiempo real, como Facebook, Instagram.

  1. https://www.scientific.net/AMM.198-199.537
  2. https://ieeexplore.ieee.org/abstract/document/777091/
  3. https://academic.oup.com/jpp/article-abstract/64/3/397/6135294

Contenido

68 comentarios en «Diferencia entre MVC y MVC2»

  1. Pingback: kinetisch zand
  2. Very good site you have here but I was wondering if you
    knew of any community forums that cover the same topics talked about
    in this article? I’d really like to be a part of online
    community where I can get opinions from other knowledgeable individuals that share the same interest.

    If you have any suggestions, please let me
    know. Appreciate it!

    Responder
  3. Hello! Quick question that’s completely off topic. Do
    you know how to make your site mobile friendly?
    My website looks weird when browsing from my iphone4.
    I’m trying to find a template or plugin that might
    be able to correct this issue. If you have any recommendations, please
    share. Appreciate it!

    Responder
  4. Excellent post. Keep posting such kind of info on your site.
    Im really impressed by your blog.
    Hello there, You have performed a fantastic job. I will definitely digg
    it and personally recommend to my friends. I am sure they’ll be benefited from this website.

    Responder
  5. Hmm it appears like your website ate my first comment (it was extremely long) so I guess I’ll just sum it up what I submitted and say,
    I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m still new to the whole thing.

    Do you have any tips and hints for rookie blog writers?
    I’d definitely appreciate it.

    Responder
  6. wonderful publish, very informative. I wonder why the opposite
    experts of this sector don’t realize this. You should proceed your writing.
    I am sure, you’ve a great readers’ base already!

    Responder
  7. Great weblog here! Additionally your web site
    loads up very fast! What host are you the use of?
    Can I am getting your associate link on your host?
    I wish my website loaded up as fast as yours lol

    Responder
  8. I loved as much as you’ll receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an impatience over that you wish be delivering the following.
    unwell unquestionably come further formerly again as exactly the same
    nearly very often inside case you shield this increase.

    Responder
  9. I’m really enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme?

    Excellent work!

    Responder
  10. I think this is among the most significant information for
    me. And i am glad reading your article. But wanna remark on few general things, The web site style is perfect, the articles is really nice : D.
    Good job, cheers

    Responder
  11. Hi I am so thrilled I found your website, I really found you by accident, while I was browsing on Google for something else,
    Regardless I am here now and would just like to say thanks for a
    marvelous post and a all round entertaining blog (I also love the theme/design), I don’t
    have time to go through it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back
    to read a great deal more, Please do keep up the
    fantastic b.

    Responder
  12. It is appropriate time to make some plans for the future and it’s time to
    be happy. I’ve read this post and if I could I wish to
    suggest you some interesting things or advice. Maybe you can write next
    articles referring to this article. I wish to read even more things about it!

    Responder
  13. I’m extremely inspired together with your writing talents and
    also with the layout on your blog. Is that this a paid subject or did you customize it yourself?
    Either way keep up the nice quality writing, it is rare to look
    a great blog like this one nowadays..

    Responder
  14. Great goods from you, man. I have understand your stuff previous
    to and you are just extremely excellent. I really like what you have acquired here, certainly like what you’re saying and
    the way in which you say it. You make it enjoyable and you still care
    for to keep it wise. I can’t wait to read far more from you.
    This is really a tremendous website.

    Responder
  15. We’re a group of volunteers and opening a brand new scheme in our community.
    Your website provided us with useful info to work on. You have performed a
    formidable task and our whole community shall be thankful to you.

    Responder
  16. Terrific article! This is the type of info that are supposed to
    be shared across the internet. Shame on the search engines for not positioning this
    publish higher! Come on over and seek advice from my web site .
    Thanks =)

    Responder
  17. Greetings! I know this is somewhat off topic but I was wondering which blog platform are
    you using for this website? I’m getting sick and tired of WordPress because
    I’ve had problems with hackers and I’m looking at alternatives for another platform.

    I would be fantastic if you could point me in the direction of a good platform.

    Responder
  18. It’s perfect time to make some plans for the future
    and it is time to be happy. I have read this post and if I could I wish to suggest you
    some interesting things or tips. Perhaps you could write next articles referring
    to this article. I wish to read even more things about it!

    Responder
  19. Magnificent goods from you, man. I’ve understand your
    stuff previous to and you’re just extremely wonderful. I
    actually like what you’ve acquired here, really like what you are saying and the way in which you
    say it. You make it entertaining and you still care for to keep it sensible.
    I can not wait to read much more from you. This is actually a wonderful site.

    Responder
  20. Hey There. I found your blog using msn. This is an extremely smartly written article.
    I’ll be sure to bookmark it and come back to learn extra of your useful information.
    Thanks for the post. I’ll certainly comeback.

    Responder
  21. What i do not understood is in truth how you are now
    not really a lot more well-appreciated than you might be right now.
    You’re very intelligent. You already know therefore considerably relating to this topic, made me
    in my view consider it from a lot of varied angles. Its
    like women and men don’t seem to be interested unless it is something to do
    with Girl gaga! Your own stuffs excellent. All the time care for
    it up!

    Responder
  22. Hey there would you mind sharing which blog platform you’re
    working with? I’m planning to start my own blog soon but I’m
    having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different
    then most blogs and I’m looking for something completely unique.
    P.S My apologies for getting off-topic but I had to ask!

    Responder
  23. I feel that is among the most vital information for me.
    And i’m glad studying your article. However want to statement on some
    common issues, The web site taste is wonderful, the articles
    is in reality excellent : D. Good activity, cheers

    Responder
  24. This is the right blog for anyone who wants to find out about this topic.
    You understand so much its almost tough to argue with you (not that I really would want to…HaHa).
    You certainly put a brand new spin on a topic which
    has been written about for decades. Excellent stuff,
    just great!

    Responder
  25. You could definitely see your enthusiasm within the article you write.
    The arena hopes for more passionate writers like
    you who are not afraid to mention how they believe. At all
    times go after your heart.

    Responder
  26. I was recommended this website through my cousin. I am not certain whether this submit is written by means of him
    as no one else recognize such special about my difficulty.
    You’re wonderful! Thanks!

    Responder
  27. Today, I went to the beach with my children. I found a sea shell and gave it to my
    4 year old daughter and said «You can hear the ocean if you put this to your ear.» She put the shell to
    her ear and screamed. There was a hermit crab inside and
    it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

    Responder
  28. Good day! I could have sworn I’ve visited this blog before but after going through some of the
    articles I realized it’s new to me. Regardless, I’m certainly delighted I stumbled upon it and I’ll
    be book-marking it and checking back often!

    Responder
  29. Terrific article! This is the kind of info that should be
    shared across the internet. Shame on Google for no longer positioning this post higher!
    Come on over and consult with my site . Thank you =)

    Responder
  30. Wow, marvelous weblog format! How long have you been blogging for?
    you make running a blog glance easy. The total glance of your website is excellent,
    as smartly as the content! You can see similar here najlepszy sklep

    Responder
  31. I’m impressed, I have to admit. Rarely do I encounter
    a blog that’s both educative and engaging, and without a doubt, you’ve hit the
    nail on the head. The issue is something which too few folks are speaking intelligently about.
    I am very happy that I found this during my search for something regarding
    this.

    Responder

Deja un comentario