miércoles, septiembre 28, 2005

Ultimos días en La Serena...

En pocos días más, viajamos de Santiago a Madrid. Tres años en Chile, entre La Serena y Santiago. De ahora en más, la Comunidad Valenciana...
Durante un mes no creo que tenga prácticamente tiempo para nada que no sea organizarnos. Posted by Picasa

viernes, septiembre 09, 2005

ECMDA: Consistencia en el desarrollo de software conducido por modelos

La Conferencia Europea en Arquitectura Dirigida por Modelos (ECMDA) tendrá en Noviembre una reunión de trabajo enfocada en el análisis de la consistencia de modelos creados con UML, en el contexto de su uso para la generación automática de código:

A number of artefacts are produced during the software developments process and MDA in particular. Those artefacts are usually expressed in UML and should be related in different way to each other. One of the most important relationship between artefacts is that they should be consistent. Putting this question into the discussion and trying to find answer to this question is the main topic to be addressed during the workshop. (...)

The following issues fall within the scope of the workshop:

  • Understanding consistency in the context of MDA and UML in particular – informal consistency from different points of views, static and dynamic consistency.

  • Definition of consistency in MDA and UML – set of properties or other techniques,

  • Checking consistency,

  • Ensuring consistency,

  • Model transformation preserving consistency,

  • Practical realization,

  • Tools support for checking and ensuring consistency,

  • Relationship between consistency and formal techniques and languages,

  • Consistency driven development process,

  • Merging models and consistency (PIM + PM ->PSM).


El material de las reuniones previas de los años 2002, 2003, y 2004, se puede consultar a partir de ésta página (link en el título de esta nota).
Todo el material es de interés no sólo para abordar el propio problema convocante, sino para entender el uso de OCL, las operaciones de transformación de modelos, y los metamodelos en UML, y aún más en general, el uso de artefactos capaces de generar código.
Un tema que particularmente estimulante, es planteado por Robert Wagner, Holger Giese, y Ulrich Nickel, de la Universidad de Padeborn, Alemania; Flexibilidad en las reglas de consistencia aplicadas:
In most CASE tools, the consistency checks being performed are rather static and predefined as they are hard coded into the tool . Thus, new consistency rules neither can be added nor can existing consistency rules be adapted to special user, enterprise, project, target language, or domain specific demands. However, during large projects you will never obtain a complete set of rules covering all relevant inconsistencies. In fact, the set of consistency rules will be expanded and refined through the whole lifecycle of a project. Thus, for a tool developer it becomes infeasible to identify all consistency rules in advance.
In this paper we present a plug-in for a flexible and incremental consistency management realized within the FUJABA TOOL SUITE. FUJABA itself is an Open Source UML CASE tool project. It was started by the software engineering group at the University of Paderborn in fall 1997 and has a special focus on code generation from UML diagrams resulting in a visual programming language. Hence, consistency management was an important issue from the beginnings since consistent specifications are a required prerequisite for an error-free implementation.
Más sobre ECMDA.
Herramientas Comerciales y Open Source participantes. FUJABA.
Historial de conferencias sobre MDA de la asociación.

sábado, septiembre 03, 2005

Una comparación sobre ambiente de seguridad entre Java y .NET

Mencionado en The Server Side (.net) por Paul Ballard, un papel de dos estudiantes, Nathanael Paul y David Evans, de la Universidad de Virginia, compara la implementación de políticas de código seguro en Java y en .Net. Con un punto de vista algo "virado al .Net", el documento es minucioso y consistente, por lo que contribuye a alcanzar dominio sobre los potenciales problemas o puntos débiles de las plataformas. Su conclusión es que .Net ofrece un mejor marco de seguridad que Java:
Java and .NET have similar security goals and mechanisms. .NET’s design benefited from past experience with Java. Examples of this cleaner design include the MSIL instruction set, code access security evidences, and the policy configuration. .NET has been able to shield the developer from some of the underlying complexity through their new architecture.

Where Java evolved from an initial platform with limited security capabilities, .NET incorporated more security capability into its original design. With age and new features, much of the legacy code of Java still remains for backwards compatibility including the possibility of a null SecurityManager, and the absolute trust of classes on the bootclasspath. Hence, in several areas .NET has security advantages over Java because of its simpler and cleaner design.

Most of the lessons to learn from Java’s vulnerabilities echo Saltzer and Schroeder’s classic principles, especially economy of mechanism, least privilege and fail-safe defaults. Of course, Java’s designers were aware of these principles, even though in hindsight it seems clear there were occasions where they could
(and should) have been followed more closely than they were. Some areas of design present conflicts between security and other design goals including fail-safe defaults vs. usability and least privilege vs. usability and complexity. For example, the initial stack walk introduced in Java has evolved to a more complex stack walk in both architectures to enable developers limit privileges. In addition, both
platforms default policies could be more restrictive to improve security, but restrictive policies hinder the execution of programs. .NET’s use of multi-level policies with multiple principals provides another example of showing the principles of least privilege and fail-safe defaults in contention with usability and
complexity. Several of the specific complexities that proved to be problematic in Java have been avoided in the .NET design, although .NET introduced new complexities of its own. Despite .NET’s design certainly not being perfect, it does provide encouraging evidence that system designers can learn from past security vulnerabilities and develop more secure systems. We have no doubts, however, that system designers will continue to relearn these principles for many years to come.
No obstante, es necesario recordar que la similitud está en el uso de una máquina virtual, pero que .Net ejecuta múltiples lenguajes sólo sobre Windows, y Java sólo un lenguaje sobre múltiples plataformas. En una decisión de arquitectura, las alternativas por ahora son más amplias sobre Java, sin mencionar la confiabilidad del sistema operativo huésped.

viernes, septiembre 02, 2005

Apuntes sobre performance en Java

Jack Shirazi sostiene una página dedicada a dar consejo en hacer ajuste fino al uso de Java, mejorando su performance. Un buen sitio no sólo para tener guía en aspectos críticos del uso del lenguaje, sino para hacerse una idea realista de cómo encarar Java con posibilidades de éxito. Acumula al día de hoy cuarenta y siete cartas sobre performance.

lunes, agosto 29, 2005

Le interesan a todos los estándares y la compatibilidad?

Developer publica un artículo sobre el test de conformidad Acid2, del Web Standards Project:

While it would seem that getting your browser to display the grinning face is simple, getting it to pass the Acid2 test is anything but. Currently there are 90 recommendations within the W3C, ranging from Cascading Style Sheets 2 (CSS 2) and HTML 4.01 to XML-binary Optimized Packaging.

WaSP's test doesn't try to incorporate all 90 recommendations, just the ones the group believes should be in all browsers based on Web developer input. It looks for basic support of HTML 4, CSS 1, data URLs and Portable Network Graphics (PNG), as well as particular implementations from these and other specifications.

The goal of the test is to get browsers to implement the Web standards tested in a consistent fashion, so what the Web surfers see using IE is the same as what another views in Safari, for example.

Lo probé con Mozilla Firefox 1.06 y con IE 6.02. El resultado es frustrante. IE 7.0 no lo soportará, según señala el artículo, y, en fin, solo tres browsers lo consiguen: Safari, iCab, y Konqueror.

UML no es OOD: cómo se relacionan

Un artículo de Craig Larman explica con algún detalle por qué UML no es igual a OOD, y por qué su uso no garantiza un diseño orientado a objetos.

viernes, agosto 26, 2005

MDA en la empresa: Visto desde múltiples perspectivas

Mikko Kontio, finlandés, presenta un breve documento en IBM Developer Works sobre las conveniencias de una arquitectura dirigida por modelo (MDA). Tanto desde el punto de vista de la conducción de los negocios, como desde el punto de vista de los diversos actores del area de TI. En pocas palabras, da un buen conjunto de argumentos en favor del estándar.

Para directivos:
MDA allows you to get more work done with the same people, or to do the same amount of work with less people. The time to completion on new projects will diminish radically, as will the time to make changes on existing systems.
La principal objeción:
In terms of cost, management will need to consider more than the price of tools. The biggest cost will be education, because not everyone in the organization will be familiar with MDA. Others may need time to become comfortable with the new approach. Therefore, the cost of the transition must be measured in time as well as money, but the end benefits should add up favorably.
Para analistas y diseñadores:

Analysts capture business requirements into a formal model. Because the work of capturing requirements is people-driven, most of it is the same regardless of approach. In MDA the formal model is Unified Modeling Language (UML), so your analysts will need to have a working knowledge of UML to implement MDA.

For the most part, the designer's job isn't affected by the transition to MDA. Designers turn analyst's models into more evolved ones, encompassing classes, state diagrams, detailed method actions, and so on. Because the designer's models are used to generate code, they must be detailed and precise. If your organization's UML tool uses executable UML, the designer will be able to more easily demonstrate the behavior of the model to customers.

Para arquitectos:
Company architects will likely be excited by your proposal to transition to MDA. MDA makes it much easier for architects to ensure that a system is implemented the way they designed it, from start to finish. As the system evolves, it will be easy to add new technologies, re-use existing code, or plug-in third-party modules. Performance tuning will be a snap using existing mappings, and documentation will always be up to date. As a result of these factors the overall quality of the system will improve, and fine-tuning it will be easier than ever. Most architects like to design and specify things before they are implemented, so for them MDA is a welcome change.
En todo caso, no suscribiría ciento por ciento la posibilidad de que la documentación esté siempre actualizada. No conozco (quienquiera puede desmentirme) herramientas del tipo MDA que puedan mantener como una colección integrada toda la documentación asociada. Por eso es interesante el concepto de Software Factory de Jack Greenfield, si el caso fuera que SF puede lograr esta integración.

Para programadores:
Every programmer knows how stupid it is to write the Customer class and its functions over and over. MDA cuts out much of that redundant work so that programmers can focus on more productive tasks like writing mappings to different platforms and fine-tuning existing mappings for specific reasons. Programmers put their platform expertise to better use this way, and they also get to concentrate on tough coding jobs that even the best MDA tools can't handle. With all the busy work cut out, programming can become more fun and also more challenging: programmers need to know their tools and languages well in order to work efficiently in an MDA environment.
Para testeadores:
Testing and maintaining are the grunt work of the development cycle, and MDA cuts out much of the worst of both. With the right tools, testers can generate test scripts directly from a system's UML model. This obviates the necessity of writing endless nearly identical test scripts and code fragments, allowing testers to focus on more crucial tasks.
Para mantenedores:
When not hunting down missing documentation, maintainers can usually be found frowning over out-of-date, poorly written documents that fail to yield the exact information they require. Not so with MDA, where the model is always current and applicable to solving real problems. MDA documentation is built in, which cuts down significantly on both frustration and high maintenance costs.
Agregaría que no sólo la documentación está integrada -aquí entendida en el sentido estricto del diseño del modelo-, sino que la inserción de cambios es simple, mucho más que la que se pueda pensar basado en un sistema no dirigido por modelo, dado que las partes están intrínsecamente integradas y articuladas, y un cambio se propaga en forma automática, reduciendo el alcance del problema a seguir la ruta del impacto, verificando conflictos que se pueden localizar en todos los casos, y a planificar las transformaciones que se deban implementar al ejecutar los cambios. (Hablando en términos generales; siempre puede haber excepciones).

Finalmente, adhiero a las recomendaciones de Mikko sobre la transición a la adopción de la arquitectura:

Convincing your organization to make the transition to MDA is only half the game: implementing the new approach is the second half. After you've adopted the MDA approach and settled on the tools you need to implement it, you'll want to embark on your first-ever MDA project together. Before you even launch the project, you should clearly spell out your goals. Admit that there is hype around MDA and explain its benefits, using the proposed project as an example. Make sure that everyone on the development team understands what you're aiming for. For example, if you want to generate a complete application, provide one or two examples so that people see it can be done. If you have a different intention, then clearly state it and provide examples to back up your goal.

Start with a good project that is small enough to process quickly. It's always best to introduce a new technology or approach with a project that is quick and relatively simple. After you've done a few smaller projects, everyone will have learned the basics and executing larger ones will be easier.

Make sure that everyone who needs support gets it. Project managers might be concerned about the amount of work involved in the new approach, the duration of certain tasks, and so on. Developers may be challenged by the unfamiliar techniques and tools. Having a knowledgeable expert or consultant on the job could be helpful in this phase of the transition.

Follow up is important. After the project is finished, make a final report detailing the successes and failures of the project. Be sure to record both -- plenty of praise for what worked as well as a clear discussion of problems and how they may be resolved in the future.

lunes, agosto 22, 2005

"la apabullante Corea"

Nora Bär, el 17 de agosto pasado, publicó un breve artículo en La Nación sobre los números de Corea: Exportaciones: 2000 millones de dólares en 1960, 557.000 millones en 1996. Producto Bruto: 8000 millones en 1960, 253.000 millones en 1996. Patentes: en 2003, 22.943.

Dice Bär :
Semejante pujanza, que a ojos de un argentino parece sencillamente "milagrosa", se debe -para Deok- a las bondades de su sólido Sistema Nacional de Innovación. Para hacerse una idea de las dimensiones de esta organización basta con mencionar que en 2003 había en Corea 297.060 personas dedicadas a actividades de investigación y desarrollo -198.171 eran científicos, alrededor de siete por cada mil personas económicamente activas-. Para mantenerla activa, Corea invierte unos 19.400 millones de dólares anuales en ciencia, el 2,64% de su PBI, una cifra en aumento año tras año.
Nuestros números, por el contrario, son innombrables. No lo podemos explicar por riqueza natural, porque Corea tiene escasas, no lo podemos explicar por la diferencia de tradición histórica, porque otros países "jóvenes" tienen buenos números. Tampoco porque hubieran permitido el ingreso del capital externo a su país, porque también nosotros lo hacemos. Ni siquiera por las historias políticas recientes, porque Corea tiene antecedentes con algunos parecidos a los nuestros. ¿No sería mejor poner el ojo en cada asunto de importancia que esté estancado, y crudamente terminar con las falacias con que los encubrimos?

jueves, agosto 18, 2005

IBM: Clasificación ortogonal de defectos

Gracias a Pablo Sánchez, que en algún momento refirió el blog de Prasanna Kumar, dí con la clasificación de IBM, actualizada por última vez en febrero de 2002 (link en el título de esta nota).
Así se introduce el problema en el Center for Software Engineering, de IBM:

Traditionally, defects represent the undesirable aspects of a software's quality. Root Cause Analysis (RCA)and Statistical Growth Modeling (e.g. S-curves) have played useful roles in the analysis of software defects. Effective RCA, while yielding exhaustive details on each defect, takes substantial investment of resources for completion and points to too many actions as a result. Growth modeling, on the other hand, provides an easy way to monitor trends, but is not capable of suggesting corrective actions due to the inadequate capture of the semantics behind the defects.

ODC is a scheme to capture the semantics of each software defect quickly. It is the definition and capture of defect attributes that make mathematical analysis and modeling possible. Analysis of ODC data provides a valuable diagnostics method for evaluating the various phases of the software life cycle (design, development, test and service) and the maturity of the product. This is much like the diagnostics done in medicine using the blood sample from a patient to understand the existing health conditions and arrive at corrective actions. ODC makes it possible to push the understanding and use of defects well beyond quality.

ODC puede representar una buena guía de referencia en el seguimiento de defectos. Probablemente pase a formar parte de mis guías rápidas de trabajo.

sábado, agosto 06, 2005

Simplemente Buenos Aires

Esto no tiene nada que ver con la informática, excepto en el medio de transporte. Simplemente, para no olvidar Buenos Aires. El mercado de San Telmo, Diagonal, Belgrano, los bares, el aire de la ciudad caminando las fotografías...una imágen habla; cien son el espíritu de la ciudad.

miércoles, julio 20, 2005

Cuál es el marco de trabajo de las DSL Tools en VS 2005?

GarethJ (J. Gareth?) mantiene referencias vivas a preguntas y respuestas de soporte en el uso de Visual Studio 2005 (y otros, supongo). Un grupo de ellas se refieren al uso del toolbox de DSL dentro del VS 2005. No quiero desconocer que cualquier esfuerzo de construcción de software es trabajoso, y se puede decir con seguridad que no existen las herramientas automáticas que reemplacen el trabajo de análisis e interpretación de los desarrolladores. Pero intuyo en el intercambio de preguntas y respuestas que este conjunto está distante de los principios que dicen sustentarlo. Evidentemente un IDE hubiera sido una respuesta de automatización en la época en que Bob Bemer explicó sus ideas de una Fábrica de Software, pero, aunque el proyecto esté instalado, parece que todavía estamos en la versión o.1.

Materiales de JavaOne 2005 disponibles

Si le interesa Java, J2EE, o la interoperabilidad entre Java y .NET, puede consultar los papeles técnicos de la conferencia 2005 de la comunidad JavaOne, soportada por Sun. Debo dar gracias al blog de Juanjo Navarro, de donde tomé el enlace (Juanjo en el enlace del título de esta nota).

sábado, julio 16, 2005

EAI-ERP: Parte de situación

El 13 de julio, IStart publica un breve artículo acerca de la evolución de las Aplicaciones de misión crítica en el mundo: "la consolidación continuará".

Bernd Fisher: Generación de código certificable

En el contexto de la 4ta conferencia de Ingeniería de Componentes y Programación Generativa, (Generative Programming and Component Engineering [GPCE'05]), varios temas de mucho interés, y entre ellos, el propuesto por Bernd Fisher: Generación de código certificable. Así se presenta el tema en la informaión previa:

ABSTRACT Code generators based on template expansion techniques are easier to build than purely deductive systems but do not guarantee the same level of assurance: instead of providing correctness-by-construction, the correctness of the generated code depends on the correctness of the generator itself. We present an alternative assurance approach, in which the generator is extended to enable Hoare-style safety proofs for each individual generated program. The proofs ensure that the generated code does not go wrong, i.e., does not violate certain conditions during its execution.

The crucial step in this approach is to extend the generator in such way that it produces all required annotations (i.e., pre-/postconditions and loop invariants) without compromising the assurance provided by the subsequent verification phase. This is achieved by embedding annotation templates into the code templates, which are then instantiated in parallel by the generator. This is feasible because the structure of the generated code and the possible safety properties are known when the generator is developed. It does not compromise the provided assurance because the annotations only serve as auxiliary lemmas and errors in the annotation templates ultimately lead to unprovable safety obligations.

We have implemented this approach and integrated it into the AutoBayes and AutoFilter program generators. We have then used it to fully automatically prove that code generated by the two systems satisfies both language-specific properties such as array-bounds safety or proper variable initialization-before-use and domain-specific properties such as vector normalization, matrix symmetry, or correct sensor input usage.

Otros trabajos: Patrones en la reingeniería de código OO, por Oscar Nierstrasz

lunes, julio 11, 2005

Cuál es el alcance real de los lenguajes de dominio (DSL)?

Vinculado al tema de Software Factories, tratado antes está el papel que se le asigne a los lenguajes de dominio (Domain Specific Languages). Entrar más en detalle en ellos es útil para valorar el alcance real de su importancia en la formula SF, así como su viabilidad de articulación con una herramienta de diseño conducido por modelos. Martin Fowler ha venido publicando varios artículos sobre DSLs relacionados a MDA y SF que abren interesantes vías de análisis:
Languages Workbenches: the killer-app for Domain Specific Languages?
Languages Workbenches and Model Driven Architecture
Entre ellos, una referencia a LABRI (Laboratoire Bordelais de Recherche en Informatique) ofrece una visión general del tema, e introduce en las características distintivas de los lenguajes, y da una lista de casos.
Un aspecto fundamental discutido es la factibilidad de construír un DSL, y quién está en condiciones de hacerlo. Cito:
(...) However, they also raise a key issue which, if not addressed, could obstruct the use of DSLs (...): how does one design and implement a DSL? Resolving this issue is critical to make the approach profitable since there is no point in reducing the complexity of program development by shifting all the complexity into the construction and maintenance of a DSL programming environment. Another related question is: who will develop DSLs? Even in the programming language community, only a few people have actually designed a language. A fortiori, we cannot expect software engineers to have the full expertise to build up new languages. Thus, it is crucial that a methodology and tools are provided to make the DSL approach widely accessible.
El laboratorio desarrolló una solución (un framework) llamada SPRINT. Ver el método que crearon para construír un Lenguaje de Dominio, da una idea de su real capacidad de ser una herramienta genérica para colaborar en el proceso de armado de un sistema (Específicamente, quiero saber cómo es de posible crear un DSL para un proyecto específico, con un problema específico, como dice la presentación de Microsoft (Think of a DSL as a small, highly focused language for solving some clearly identifiable problem that an analyst, architect, developer, tester, or system administrator must wrestle with. Developers are already familiar with examples of DSLs; SQL for data manipulation, XSD for XML document structure definition, and so on. Another example from Visual Studio Team Edition for Software Architects is a DSL for modeling the logical structure of datacenter hardware and host software configurations. This DSL and its related graphical designer can be used to validate during design time that applications are configured to match their intended deployment targets, alerting the developer to problems when they can be fixed more cheaply.Good ways to find candidate DSLs are to identify the patterns used by developers, and then to encapsulate them into a modeling language, or to surface the concepts in a software framework as abstractions in a modeling language that can then generate small amounts of code that extend the framework. These techniques allow us to control the amount and complexity of generated code, offering real value to the developers, without the hassles that characterized CASE products.)

Sigue la descripción del marco metodológico a seguir para especificar un DSL según Sprint:
Our methodology is based on a framework outlined in an earlier paper by Thibault and Consel and put into practice in several DSL prototypes (GAL, PLAN-P) and publications . It can be summarized as follows. (For the sake of clarity, the phases of our methodology are presented sequentially. In practice, the whole process needs to be iterated.)
Estos son los pasos a seguir:

Language analysis
Assuming a problem family has been identified, the first step is to analyze the commonalities and the variations in the corresponding program family. This analysis is fueled by domain knowledge. The result of this analysis includes a description of objects and operations that are needed to express solutions to the family of problems, as well as language requirements (e.g., analyzability) and elements of design (e.g., notations).

Interface definitions
The next phase is to refine the design elements of the DSL. To do so, the syntax of the DSL is defined and its informal semantics is developed. The informal semantics relates the syntactic constructs to the objects and operations (i.e., the building blocks) identified previously. Additionally, the domain of objects and the type of operations are formalized, thus forming the signature of semantic algebras.

Staged semantics
The semantics of a GPL is typically split between the compile-time and the run-time actions. These two parts are also referred to as the static and the dynamic semantics of a language. We propose to perform the same separation in the semantics of a DSL. With respect to software architecture concerns, this separation makes stages of configuration explicit.

Formal definition
Once the static and dynamic components of the language have been determined, the DSL is formally defined. Valuation functions define the semantics of the syntactic constructs. They specify how the operations of the semantic algebras (i.e., the building blocks) are combined.

Abstract machine
Then, the dynamic semantic algebras are grouped to form a dedicated abstract machine which models the dynamic semantics of the DSL. From the denotational semantics, the DSL is given an interpretation in terms of this abstract machine. The state of the semantics is globalized and mapped into abstract machine entities (e.g., registers) dedicated to the program family.

Implementation
The abstract machine is then given an implementation (typically, a library), or possibly many, to account for different operational contexts. The valuation function can be implemented as an interpreter based on an abstract machine implementation, or as a compiler to abstract machine instructions.

Partial evaluation
While interpreting is more flexible, compiling is more efficient. To get the best of both worlds, we use a program transformation technique, namely, partial evaluation, to automatically transform a DSL program into a compiled program, given only an interpreter. Writing the language definition as an interpreter allows fast prototyping, and easier maintenance and extension. However, it does not compromise efficiency as partial evaluation is able to remove the interpretation layer overhead, yielding efficient DSL implementations.
Como se ve, construír un DSL, aun con el auxilio de una herramienta que encauce metodológicamente y abrevie pasos, no es una tarea trivial. Sin hablar de que existe un paso previo metodológico no cubierto (Assuming a problem family has been identified...)
Ni cuestiono los DSLs, ni mucho menos el desarrollo de esta herramienta, para aumentar el campo cubierto por DSLs específicos. Sólo pongo en duda con fuerza la posibilidad de que una colección de DSLs sea la alternativa a un modelo de herramienta del tipo MDA.
En forma desnuda, las afirmaciones de Greenfield y Microsoft no son sino una promesa o una especulación comercial, y la cruda verdad es que estamos hablando del Visual Studio usando C# u otro lenguaje .NET, para hacer interfaz con aquellos DSL que existan, cuando el problema se presente,...y el resto es C#, es decir, lo mismo.

lunes, julio 04, 2005

El duro trabajo de salir del enfoque procedural

Me inicié en la programación aprendiendo de profesores y mentores que a su vez se iniciaron desde el Assembler y el Fortran hasta el Cobol. Como he reconocido, mi primer contacto con Yourdon fue cuando la programación y el diseño estructurado eran la forma correcta de hacer las cosas. Por lo tanto, a diferencia de los nuevos programadores o analistas o diseñadores, siempre tengo que pensar dos veces un problema: primero la vía "natural" procedural, y luego como mundo de objetos. Andando el tiempo, sin embargo, encuentro que en el mundo diario, es mucho más frecuente encontrar el modo de enfocar un problema orientado a los procesos, que el modo basado en objetos. Dos o tres discusiones en comp.object, el grupo Google que me resulte de mayor interés, me muestran sin embargo que los tropiezos no son sólo míos. En el link que titula esta nota se menciona a uno de estos casos, donde Lahman reenfoca desde el punto de vista de objetos un algoritmo presentado como secuencia de procesos.
Pero el más interesante y valioso de los varios casos sobre lo mismo es el llamado "OOP/OOD Philosopy". Invito a seguir la discusión y poner a prueba sus criterios.

lunes, junio 20, 2005

Otro ejemplo del compromiso europeo con MDA

El ESI (European Software Institute) con sede en Zamudio, España, junto al
Fraunhofer-Gesellschaft de Munich y el IKV++ Technologies AG, de Alemania, y Thales ATM, con sede en varios países, trabajan en común en un proyecto de evaluación temprana de los conceptos de MDA:
The objective of MASTER project (IST-2001-34600) is to perform an early validation of the concept of MDA (Model Driven Architecture) which is currently being promoted by the OMG (Object Management Group). The validation consists in an experimental approach. MDA concepts are to be applied in the Air Traffic Management (ATM) domain and is focused on achieving the following more detailed objectives:
  • Develop a variability specification language and apply it to the ATM domain to improve customising requirements according to the final user needs, and map variability (open decisions) on to the architecture.

  • Provide the mechanisms to derive and analyse the development process activities and project management parameters (such as cost, effort, time, etc.) since the very early stages in contract negotiation and project definition, by using the architecture as the basis for reasoning about this.

  • Implement the MDA concepts of separation of concerns to achieve independence from specific platform technologies and therefore enable the specialisation of resources (business knowledge separate from technological knowledge)

Additionally, the project aims at providing tool support for these activities. Tool support will allow for the modelling of variability among ATM systems using a variability specification language, automate the project management based analysis on the architecture and support the transformation mappings among different levels of abstraction of an MDA approach.

Finally, one very important aim of the project is to contribute to the development of the MDA standard and the consolidation of ATM domain. The project plans to achieve this through active participation in the standardisation groups of OMG.
Vea su esquema de implementación de MDA aquí

viernes, junio 17, 2005

Microsoft y MDA-MDD - Domain Specific Languages

Uno de los pilares de la visión de Microsoft sobre el uso de modelos, señalado en su documento "Visual Studio 2005 Team System Modeling Strategy and FAQ" es el uso, recomendación y soporte de lenguajes específicos de dominio. Los DSL son propuestos como un diferencial respecto al estándar MDA de OMG, sobre el que se señala que

Microsoft has learned from past industry experiences, and plans to avoid the pitfalls of CASE by adopting an approach to model-driven development based on the following ideas:

  • A model should be a first-class artifact in a project—not just a piece of documentation waiting to become outdated. Models have a precise syntax, are often best edited and viewed using a graphical tool, and embody semantics that determine how domain-specific concepts in models map to other implementation artifacts, such as code, project structures, and configuration files. In this way, a model is a lot like a source code file, and the mechanisms that synchronize it with other implementation artifacts are a lot like compilers.
  • A model represents a set of abstractions that support a developer in a well-defined aspect of development. (...)
  • Since models can abstract and aggregate information from a number of artifacts, they can more readily support consistency checks and other forms of analysis. For example, an application connectivity model might support contract protocol validation, security analysis, or performance analysis.
  • Models can be implemented by a process similar to compilation, where the code, configuration files, and other implementation artifacts generated by the compiler are never edited by hand. More often, however, they are implemented by a combination of generated and hand-edited artifacts. In such cases, it is critically important to carefully manage the way the generated and hand-edited artifacts fit together. As mentioned above, the failure to do this effectively was one of the primary shortcomings of CASE products. We have been using several techniques to ensure that generated and hand-edited artifacts are kept separate, and that code added by a developer is never disturbed when boilerplate code required by a tool is generated. These techniques include the use of class delegation and inheritance, and particularly the use of "partial classes," a new feature of the .NET languages in Visual Studio 2005, which has been specifically defined with this task in mind.

We call modeling languages defined in these ways Domain Specific Languages or DSLs. Think of a DSL as a small, highly focused language for solving some clearly identifiable problem that an analyst, architect, developer, tester, or system administrator must wrestle with. Developers are already familiar with examples of DSLs; SQL for data manipulation, XSD for XML document structure definition, and so on. Another example from Visual Studio Team Edition for Software Architects is a DSL for modeling the logical structure of datacenter hardware and host software configurations. This DSL and its related graphical designer can be used to validate during design time that applications are configured to match their intended deployment targets, alerting the developer to problems when they can be fixed more cheaply.

Good ways to find candidate DSLs are to identify the patterns used by developers, and then to encapsulate them into a modeling language, or to surface the concepts in a software framework as abstractions in a modeling language that can then generate small amounts of code that extend the framework. These techniques allow us to control the amount and complexity of generated code, offering real value to the developers, without the hassles that characterized CASE products.

Microsoft recently announced the DSL Tools, which will enable customers and partners to build DSLs using the same technology in Visual Studio 2005 that we used to build the modeling tools that will ship with Visual Studio Team Edition for Software Architects. This technology, which can be thought of as "tools to build tools," simplifies the task of defining DSLs and reduces the effort and skills required to build graphical editors and compilers for them.

La idea de usar lenguajes específicos para problemas específicos es contrapuesta a la idea de los modelos específicos de plataforma (PSM), suponiendo que para una plataforma corresponde un solo modelo de plataforma. Independientemente de que sea corrientemente así o no, no parece esta una razón para oponerlos. Sí es correcto en todos caso que un DSL puede ser el soporte de generación de un modelo dado.
La idea de crear código combinando generación automática y trabajo manual, mantiene al producto dentro del marco que MS cuestiona para los modelos desarrollados desde UML. No hay ninguna diferencia: (Models can be implemented by a process similar to compilation, where the code, configuration files, and other implementation artifacts generated by the compiler are never edited by hand. More often, however, they are implemented by a combination of generated and hand-edited artifacts. In such cases, it is critically important to carefully manage the way the generated and hand-edited artifacts fit together)
El código manual siempre será opaco para el modelo, por lo que fácilmente devendrá desincronizado, y exige seguimiento del desarrollador acerca de la coordinación entre ambos mundos.
Los DSL son productos orientados a la solución de problemas determinados, bien definidos para cada caso, bien probados, y con la solución más adecuada al caso. Así lo indica el artículo, así lo conocemos de otras definiciones. La novedad que ofrece MS es ofrecer una herramienta para la construcción de DSLs. Esto es coherente con ofrecer como contraposición a un PSM (Platform Specific Model) los DSLs en general: es decir, si se va a decir que los DSL son la solución frente al mapeo que se produce entre un PIM y un PSM, debe ser posible construír un DSL para cada problema vinculado a una plataforma que se presente. Es eso posible? Sin duda que se puede construír un generador o mapeador a un problema que tenga reglas que ya se aplicaban manualmente. Pero es viable?. Seguramente, dependiendo de la magnitud del proyecto, o de la continuidad con que el mismo problema deba ser resuelto. Si se dispone de un equipo que pueda dedicar la cantidad de horas hombre necesarias, y el conocimiento correspondiente, para crear todas los algoritmos que interpreten un dominio, y que testeen todos los escenarios posibles, seguramente se logrará crear un DSL que cumpla con todos los requisitos propuestos. Seguramente dedicarse a este objetivo no está en el ámbito de la productividad y reducción de costos que se proponen los desarrollos basados en modelo y generadores. Salvo que estemos hablando de empresas de primer orden mundial. En el resto del prosaico mundo, la exigencia por resolver problemas con el menor costo implica que la búsqueda de herramientas de desarrollo rápido trate de conseguir eso: desarrollo rápido.
Así, el toolbox para crear DSLs, es seguramente una herramienta para empresas de software dedicadas a nichos de software que trabajen con .NET y Visual Studio.
Poco, estrecho alcance para el nivel de la crítica presentada por la visión de Microsoft a la OMG.

lunes, junio 13, 2005

Microsoft y MDA-MDD - Segunda aproximación

Yendo adelante con la nota anterior, quisiera entrar un poco más en la visión de Microsoft.
Debo aclarar que tengo un prejuicio, y es que la insistencia de MS en desechar, desvalorar o desacreditar los dos estándares de OMG relacionados (MDA y UML) tiene una simple razón comercial. El mejor resultado de desentrañar su iniciativa, sería determinar los valores positivos que la estrategia de modelado de MS pueda aportar.
También debo decir que yo mismo, por mi experiencia personal con Plex, puedo coincidir en que no necesariamente se debe construír un producto por medio de transformaciones de un modelo generado a partir de un esquema UML. Aunque creo que entre los propios constructores del estándar, aceptan que pueden existir otras vías de pasar desde un modelo hacia una aplicación.
Salvado esto, quisiera enfocar el punto más valioso de la estrategia MS:
In our opinion, a single PIM and a single PSM per target platform, all developed using a general purpose modeling language, as prescribed by MDA, are insufficient to support the significantly greater levels of automation promised by model-driven development.
De acuerdo. Tratar de elevar el diseño orientado por modelos a un esquema que soporte en forma amplia el ciclo de vida completo de una aplicación, es una consecuencia natural de la construcción evolutiva de un modelo.
Cómo se ejemplifica en el documento de MS:
Rich automation of the software life cycle requires many additional types of models, such as models that:
  • Capture, analyze, and manage requirements; identifying trace relationships between requirements, architectural design and implementation constructs, enabling validation that requirements have been implemented, and supporting impact analysis when requirements change.
  • Define software architecture in a way that supports security, performance and reliability analysis, and other forms of evaluation; and in a way that enables predictable assembly of systems from components, and efficient and reversible step-by-step transformations from requirements and deployment,
  • Define how the executable components of a system are packaged, identifying the types of resources in the deployment environment required by each component, and binding the components to specific instances of those resource types,
  • Define test cases, test data sets, test harnesses, and other artifacts, making it easier to evaluate the quality of software developed using models, and to manage and display the test results
  • Identify traceability relationships between models and other artifacts, making it easier to support business impact analysis when systems go down, configure systems to satisfy requirements, and enforce constraints during system configuration,
  • Define configurations of source artifacts used to build executables, making it easier to version those configurations, and to associate defect reports and feature change requests with specific versions.
Dejando de lado que algunos de estos casos debieran ser contemplados hoy día por un esquema UML (seguramente el ítem 3), hay aquí un conjunto de escenarios que requerirían conducción, trazabilidad, interconexión o integración, automatización, y que cubren un paso más que lo que hoy una transformación PIM => PSM puede alcanzar. Muchos de ellos pudieran ser encarados encauzando el uso de un modelo dentro de una herramienta de manejo de configuración, que hoy cubren casi todos los ítems, al menos en una forma secuencial histórica. Pero mucho mejor sería que el mismo modelo articulara todos estos aspectos.
MS habla de "many additional types of models" para referirse al modo en que estos aspectos serían expresados, planteando el problema como una colección de modelos. Me conforma más la idea de OMG que habla de visiones encaradas por distintos diagramas. La idea de colección de modelos me hace pensar que la integración de ellos se lograría por medio de la IDE en la que se describieran y recolectaran, con lo que deja un grado de subjetivismo en cómo serán interpretados o aplicados. Más aún, cuando la IDE en que están incluídos es una parte del Visual Studio mismo, en donde la construcción de código tiene de automático aquello que pueda ser derivado de un wizard, una clase heredada, un header, o un patrón aplicado. Sobre esta característica retornaré en otro momento.
En resumen, la idea de extender, y las áreas propuestas de extensión, son de real interés, y creo que son valiosos generadores de ideas. El cuánto sea esto logrado en esta iniciativa, es algo que debe verse bajando más cerca de cada una de las herramientas concretas con las que se lo intenta. En cambio, el hecho de manejar estos recursos como una colección, sugiere que la idea no está acabada, y que en estos términos puede ser incluso peligrosa, excepto que se tenga una buena disciplina para su utilización. El desarrollo basado en modelos justamente se propuso atacar la complejidad del diseño, facilitando la visión arquitectónica, yendo hacia la abstracción, y poniendo bajo control la complejidad de las decisiones de detalle. De un modo en que la cascada de consecuencias que se derivan de las definiciones en el modelo abstracto, estén bajo control. No veo en el esquema propuesto por MS facilidades amplias de este tipo. Pudiera convertirse en lo contrario.
Volveremos sobre esto avanzando un poco...

miércoles, junio 08, 2005

Microsoft explica su posición sobre MDA-MDD

El 1 de junio Paul Ballard publica una breve nota en The Server Side presentando el documento oficial de Microsoft donde se explicita en mayor detalle su posición sobre el desarrollo basado en modelos. Quince páginas (ver el artículo en el enlace del título de esta nota) para describir el concepto de Software Factory, los puntos de contacto y las diferencias con UML y MDA:
Customers and partners are keen to understand Microsoft's strategy for model-driven development and its support in Visual Studio Team System. When we explain our strategy to them, they frequently express interest in some of the same topics, and raise some of the same concerns. In this document we set out our strategy for model-driven development as a series of questions and responses that address these topics and concerns. The first five questions deal with the main pillars of our strategy, which we have described with detailed answers and explanations.
En los próximos días trataré de sacar lo mejor del documento...