1 / 13

Arquitectura DNA

Arquitectura DNA. Componentes ActiveX Base de Datos. Arquitectura DNA. DNA (Distributed InterNet Applications Architecture) de Microsoft Diseño de aplicaciones de 3 capas. Servicios de Presentación Servicios de Lógica de Negocios Servicios de Datos. Aplicación de 3 Capas en Web.

Download Presentation

Arquitectura DNA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Arquitectura DNA Componentes ActiveX Base de Datos

  2. Arquitectura DNA • DNA (Distributed InterNet Applications Architecture) de Microsoft • Diseño de aplicaciones de 3 capas. • Servicios de Presentación • Servicios de Lógica de Negocios • Servicios de Datos

  3. Aplicación de 3 Capas en Web Equipo NT 1 Equipo NT 2 Internet InformationServer y ASP SQL Server HTTP Componentes COM Browser HTML DCOM Servicios de Datos Presentación Lógica de Negocio

  4. Lógica de Negocios • Los componentes de la lógica de negocios con soporte COM+ pueden desarrollarse como DLL’s tipo ActiveX en : • Visual Basic 6.0 • Visual C++ 6.0 (por motivos de rendimiento)

  5. Cómo crear una DLL • En Visual Basic 6.0 crear un nuevo proyecto ActiveX DLL

  6. ...Cómo crear una DLL • En Project/References especificar las librerías a utilizar, por ejemplo:

  7. ...Cómo crear una DLL • Agregar las clases necesarias • Procedimientos • Funciones • Agregar Módulos .BAS • Rutinas Generales • Grabar el proyecto • proyecto.vbp (definición del proyecto) • archivos.cls (cada una de las clases) • archivos.bas cada uno de los módulos

  8. ...Cómo crear una DLL • Para validar si no hubo problemas con la ejecución de una DLL se recomienda que en cada función se tengan las siguientes líneas: Dim oContext As ObjectContext On Error GoTo ManejoError Set oContext = GetObjectContext ........ ‘ código If Not oContext Is Nothing Then ' Program is running under COM+ GetObjectContext.SetComplete ' Alert MTS that operation was successful End IF Set adoCmd = Nothing ‘si hay comandos de base de datos Exit Function

  9. ...Cómo crear una DLL ManejoError: If Not oContext Is Nothing Then ' Program is running under COM+ GetObjectContext.SetAbort ' Alert MTS that operation failed nombre_función = False ‘si es que es función booleana Set adoCmd = Nothing ‘si hay comandos de base de datos End If Err.Raise Err.Number, Err.Source & " " & ”Clase.Función", Err.Description End Function

  10. ...Cómo crear una DLL • Crear la DLL • En File / Make proyecto.dll • Asignar nombre • En el Component Services • Crear nueva aplicación (Empty or prebuilt) • Registrar la DLL (drag and drop)

  11. Ejemplo • Suponer que se tiene una DLL llamada Convierte.DLL y esa DLL tiene una clase llamada CNumeroLetra. • La clase tiene varias funciones y una de ellas es la siguiente: Public Function NUMERO_A_LETRA(ByVal numero As Variant, ByVal MEDIDASINGULAR As variant, ByVal MEDIDAPLURAL As variant) As String ...... End Function

  12. ...Ejemplo • En una ASP, cuando se quiera utilizar la función anterior es necesario hacer lo siguiente: <% set objLetra = Server.CreateObject(”Convierte.CnumeroLetra") letra = objLetra.NUMERO_A_LETRA(request("cantidad"),"PESO","PESOS") %>

  13. Base de Datos • Ver ejemplo

More Related