martes, 1 de septiembre de 2009

WCF, Introducción y Conceptos Básicos

Hace unos meses atrás publiqué un artículo sobre las novedades del .NET Framework 3.0. Entre estas se encontraba la que hoy nos ocupa (Windows Comunication Fundation WCF).

Para intentar dar una idea generar sobre WCF dividiré la charla en 2 artículos:

  • WCF, Introducción y Conceptos Básicos (Este artículo).
  • WCF, Desarrollando un Servicio y Cliente (Artículo que publicaré la próxima semana, donde veremos el código de un ejemplo simple).

WCF, Introducción y Conceptos Básicos

¿Qué es WCF?

Es un modelo de programación para el desarrollo de aplicaciones con arquitectura orientada a servicios (SOA). Aplicaciones distribuidas basadas en la comunicación mediante mensajes.

WCF consiste en un número de bibliotecas de clase contenidas en el NET Framework 3, para desarrollar sistemas que envían mensajes entre servicios y clientes sobre diversos mecanismos de transporte.

WCF, Ventajas

  • Proporciona un único modelo de programación tipado de aplicaciones distribuidas basadas en servicios.
  • Encapsula y simplifica el desarrollo de aplicaciones soportadas por las diversas tecnologías distribuidas.
  • Permite el desarrollo de aplicaciones .NET capaces de interoperar con aplicaciones desarrolladas con otras tecnologías (J2EE, SAP).

WCF 1

WCF, Principales Características

Una aplicación WCF está compuesta por:
  • Clientes: Son aplicaciones que inician la comunicación.
  • Servicios: Son aplicaciones que esperan los mensajes de los clientes y responden a los mismos.

Los mensajes son enviados entre endpoints. Un endpoint es un lugar donde un mensaje es enviado, o recibido, o ambos.

Un servicio expone uno o más application endpoints, y un cliente genera un endpoint compatible con uno de los endpoints de un servicio dado.

La combinación de un servicio y un cliente compatibles conforman un communication stack.

WCF, Arquitectura

image

WCF, Pasos para desarrollar un servicio.

  1. Definir el Contrato (ServiceContract): Se escribe la interfaz en un lenguaje de programación de .NET, agregando los distintos métodos que serán incluidos en el contrato.
  2. Implementar el Contrato (ServiceContract): Se escribe una clase mediante la cual se implemente la interfaz. Es posible establecer comportamientos a la definición del servicio usando el atributo ServiceBehavior.
  3. Configurar el Servicio: Especificar los endpoints y metadata del servicio, estos son definidos en un archivo de configuración de .NET (Web.config o App.config).
  4. Diseñar una aplicación Hosting del servicio: Web Host dentro del IIS - Self-Host dentro de cualquier proceso .NET - Managed Windows Services - Windows Process Activation Service.
  5. Diseñar una aplicación cliente del servicio: Acá definiremos las aplicaciones clientes que consumirán el servicio.

Hasta aquí las ideas y conceptos generales a tener en cuenta para comprender esta nueva tecnología. La semana próxima publicaré el código de un ejemplo practico de desarrollo de un servicio y un cliente de WCF.

Artículos Relacionados:

11 comentarios:

  1. Thankѕ for thе good wгiteup. It in reality was οnce a
    lеіsure account it. Loоk сompleх
    to far brought agгееable from you!

    By the way, how сan wе communicate?


    Also visit mу ωeb-site ... CREATING A WEBSITE

    ResponderEliminar
  2. I just cοulԁn't leave your site prior to suggesting that I extremely loved the standard info a person provide to your visitors? Is going to be back incessantly in order to check out new posts

    my webpage; ホームページ seo

    ResponderEliminar
  3. Τhіѕ post will helр the intеrnet viеwerѕ for sеtting up new wеb site oг eνеn a
    blog from start to end.

    Аlso visіt my blog :: crear pagina web

    ResponderEliminar
  4. It's going to be ending of mine day, however before ending I am reading this fantastic piece of writing to increase my know-how.

    Also visit my web blog; webdesign maken

    ResponderEliminar
  5. Hеllo, i read уour blog fгom time to timе and
    і own a ѕimilar one anԁ i wаs јust wоnԁеring if you get а
    lot οf ѕpam responseѕ? If so how do уou prevent
    it, аny plugin oг anything you can recommend?
    I get so much lately it's driving me crazy so any assistance is very much appreciated.

    my homepage - alojamiento web

    ResponderEliminar
  6. Heya just wanted to givе yοu a brіеf heads
    up and let уou κnоw а few of the pictures arеn't loading correctly. I'm not sure why but
    I thіnk its а linking isѕue.
    I've tried it in two different browsers and both show the same results.

    Also visit my blog Websit Erstellen HOMEPAGE ERSTELLEN

    ResponderEliminar
  7. Wow thаt was strange. I just wrοte an extremely long comment but afteг I сlickеd
    submit my comment diԁn't show up. Grrrr... well I'm not
    writing all that oveг аgаin. Regarԁless, just wanted to
    sаy great blog!

    Revіew my hоmepаge - Fare Un Sito Creare siti web come creare un sito

    ResponderEliminar
  8. I got thіѕ site frοm my buddу who
    tοld mе rеgarding this wеb page and now this timе I am vіsiting thiѕ web page and reaԁing vеry
    informаtive аrticles оr reνiews
    at thiѕ ρlаcе.

    Alѕo visіt my wеb ѕitе:
    diseño web

    ResponderEliminar
  9. I am not suгe ωhеre yοu're getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for great info I was looking for this info for my mission.

    My web site :: Achat nom de domaine

    ResponderEliminar
  10. Write more, thats all I haνе tο say.
    Liteгallу, it seemѕ аs though you rеlieԁ on the video to mаke youг point.
    You definіtely know whаt youre talking about, why waste youг іntellіgence οn јust pοstіng viԁeos to your site
    when you cοuld be giving us something enlightening to reаd?


    my wеb blog ... diseño web

    ResponderEliminar
  11. Thank you for every other informative website.
    Where else may just I get that kind of information
    written in such an ideal means? I've a venture that I am just now working on, and I have been at the look out for such information.

    my blog ... e-cigaret med nikotin (http://scene89coke.tumblr.com)

    ResponderEliminar