VDM++ Tutorial Implementing in Java. Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
Advertisements

.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
Model Driven Generative Programming Reza Azimi February 6, 2003 ECE1770: Trends in Middleware Systems.
Java Server Pages (JSP)
Utilities (Part 3) Implementing static features 1.
Remote Method Invocation
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Software Testing and Quality Assurance
Static and Dynamic Contract Verifiers For Java Hongming Liu.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Computer Science 340 Software Design & Testing Design By Contract.
Component-Based Software Engineering Components and Interfaces Paul Krause.
SCRAM Software Configuration, Release And Management Background SCRAM has been developed to enable large, geographically dispersed and autonomous groups.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Microsoft Visual Basic 2005: Reloaded Second Edition
Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
The New Zealand Institute for Plant & Food Research Limited Matthew Laurenson Web Services: Introduction & Design Considerations.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
Lexical Analysis - An Introduction. The Front End The purpose of the front end is to deal with the input language Perform a membership test: code  source.
Writing JavaDocs Mimi Opkins CECS 274 Copyright (c) Pearson All rights reserved.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
Exception Handling in JAVA. Introduction Exception is an abnormal condition that arises when executing a program. In the languages that do not support.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Programming Principles Chapter 1. Objectives Discuss the program design process. Introduce the Game of Life. Discuss object oriented design. – Information.
VDM++ Tutorial Model Quality. Overview Introduction Assessing internal consistency Assessing external consistency.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
TIVDM2Model Quality1 Peter Gorm Larsen. TIVDM2Model Quality2 Agenda  Introduction Internal Consistency External Consistency.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
 Common Object Request Broker Architecture  An industry standard developed by OMG to help in distributed programming.
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
1  lecture slides online
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
VDM++ Tutorial Concurrency. Overview Introduction Concurrency primitives in VDM++ Example: POP3 Server Concurrency and VDMTools ®
SWE 4743 Abstract Data Types Richard Gesick. SWE Abstract Data Types Object-oriented design is based on the theory of abstract data types Domain.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Know Your Java. Java is special Java source code Byte code/ native code Object code on windows Object code on Dos Object code on Lynux.
Java Object-Relational Layer Sharon Diskin GUS 3.0 Workshop June 18-21, 2002.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
Online Data Monitoring Framework Based on Histogram Packaging in Network Distributed Data Acquisition Systems Tomoyuki Konno 1, Anatael Cabrera 2, Masaki.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
Applications Active Web Documents Active Web Documents.
Introduction To Design Patterns
Google Web Toolkit Tutorial
Introduction to Advanced Java Programming
Objectives You should be able to describe: Interactive Keyboard Input
Remote Method Invocation
CSE 374 Programming Concepts & Tools
Introduction to javadoc
JavaScript an introduction.
Using ASIS to Generate C++ Bindings
Computer Science 340 Software Design & Testing
Java Object-Relational Layer
Presentation transcript:

VDM++ Tutorial Implementing in Java

Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example

Introduction Benefits of automatic code generation Drawbacks of automatic code generation

Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example

Overview of Java Code Generation VDMTools ® Java Code Generator VDM++ Model Handwritten Java Java Files VDM.jar Executable code

Overview of Java Code Generation (2) VDM++ model Must be type correct Not all VDM++ language constructs supported Handwritten Java main function must be provided Further handwritten code may be provided (e.g. GUI)

Overview of Java Code Generation (3) VDM.jar Utility methods required by the generated code Distributed with VDMTools ®

Code generation example VDM++ op : nat ==> () op(n) == i := i + n Java private void op (final Integer n) throws CGException { i = UTIL.NumberToInt( UTIL.clone( new Integer( i.intValue() + n.intValue()))); }

Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example

Options for Java code generation Several user-definable options exist These dictate which parts of the model are code generated and/or how the model is code generated. Generate only skeletons Generate only types Generate integers as longs Generate code with concurrency constructs Generate pre- and post functions/operations Check pre- and post-conditions Select interfaces

Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example

Keep tags It is sometimes desirable to hand-edit the generated code. These edits could be lost if the code is regenerated. Keep tags prevent this problem. Special comments surrounding each generated element.

Keep tags example // ***** VDMTOOLS START Name=op KEEP=NO private void op (final Integer n) throws CGException { i = UTIL.NumberToInt( UTIL.clone(new Integer(i.intValue() + n.intValue()))); } // ***** VDMTOOLS END Name=op

Overview Introduction Overview of Java code generation Options for Java code generation Keep tags POP3 Example

POP3 server example described earlier can be code generated into Java, compiled and executed. The POP3 client GUI also described earlier can be reused with the generated code.

Server side Code automatically generated, using VDMTools ® concurrency option External interfaces must be “wrapped” to allow communication via sockets

Server side (2)

Client side POP3 client GUI used for assessment of external consistency reused. Exploits a variation of the Factory Method pattern

Client side (2)

Summary Benefits and drawbacks of automatic code generation Practical tool support Realistic example