-------------------------------------------------------------------------- Adaptive Object-Oriented Software Fall 1995 COM 3360/NTU SE737 Prof. Karl Lieberherr --------------------------------------------------------------------------- Project selection Due dates: Project selection: due Nov. 6 Progress reports: weekly, preferrably by e-mail Class dictionary: Nov. 6 1. evolution phase tested: Nov. 13 last evolution phase tested: Dec. 4 turn in your project: Dec. 4 --------------------------------------------------------------------------- Use the newsgroup ccs.courses.com3360 to communicate with the class. PROJECT: You have now gained enough background in adaptive object-oriented software development that you can approach a sizable project. You should choose a project you are really interested in from the list below. The projects vary in their level of specification: the projects which have a detailed functional specification are the ones which have already been implemented in the Demeter Tools, like sem-check. But sem-check and some of the other tools are written without propagation patterns and the goal is to find out how much shorter those programs become once they are implemented with propagation patterns. Furthermore, all those tools need a significant rewrite to make them suitable for a graphical user-interface. Please don't consider those reimplementations to be uninteresting tasks. It requires a lot of cleverness to find the right propagation patterns and I am very interested in your elegant propagation pattern solutions and in your feedback on how you found them (we need a design method for propagation patterns). How do you go about doing your project. 1. You get a class dictionary for your input and output objects by using whatever technique is appropriate (copy from my directories, write it yourself). You debug your cd with sem-check and you generate an environment. 2. You break your task into subtasks and for each task you find a group of collaborating classes which are needed to accomplish the task. This might lead to an extension of your cd, after which you regenerate. You partition (with overlaps) your group of collaborating classes into groups of signature-equivalent classes and for each such group you write a propagation pattern. 3. You write growth plans and debug your pps according to your growth plans. The theme of several of the recommended projects is: graphical user-interface design for a programming tool. You have used the Demeter Tools/C++ with a textual interface. While this interface is a reasonable tool to learn about object-oriented software development, the interface can be significantly improved and made graphical and much more interactive. With such an interface, the tools will have a much greater utility and will be more pleasant to use. Therefore, we want to develop a GUI for the Demeter Tools/C++. While the theory about class dictionary graphs and propagation patterns will still be applicable, the GUI version of the tools requires a significant redesign. Consider the sem-check tool: it should give us feedback as we draw the class dictionary graphs. Below are several projects which involve GUI design. To speed up graphical user-interface development, you are invited to use Tcl/Tk from Berkeley. Alternatively, Motif from the Open Software Foundation is a widely used GUI building tool. But it is much harder to use. Motif is not recommendeded if you don't already know it. P R O J E C T S L I S T ========================= IMPORTANT: Not all the projects have the same popularity and some are easier than others. If feasible, build teams of 2-3 people who work on the same project. Each team should have a spokeswoman or spokesman who interfaces with me and/or a consultant (a graduate student who specializes in the area of your project.) Project Ideas for COM3360/NTU SE 737 Demonstration projects =============================================================== Choose a suitable part of a project which you and others implemented elsewhere and redo that part with Demeter and maybe Isthmus. It would be good to have statistics on the old project regarding code size and development time etc. Keep a good record of statistical information for the new project and compare the results for the old project with the results for the new project. How can you measure the flexibility of the adaptive software relative to the old software? =============================================================== Visual Programming Using Demeter and Isthmus, develop a tool for developing propagation directives graphically. ==================================================================== Improve Portability of Demeter Tools For non-experts it is time-consuming to port Demeter to a new platform, e.g., Linux. Improve the structure and documentation of the system so that porting becomes easier. Apply improved porting process to one port. =============================================================== Unified Method Booch and Rumbaugh and Jacobson have set out to integrate their methods. (See the Rational document below. Order it, if you want to do this project.) Generalize Adaptive Programming so that class diagrams of the Unified Method may be used as customizers of Adaptive Programs. ------ Copies of the Rumbaugh/Booch Unified Method paper are available free of charge from Rational Software Corporation. To receive a copy, please email your snail mail address to product_info@rational.com ================================================================== Evolution of Adaptive Programs The work of Huersch and Seiter has studied automatic evolution of adaptive programs under certain class dictionary transformations. Implement some of the transformations. =================================================================== Standard Template Library STL is now available and is a standard. Replace the Demeter Repetition class by the STL library and extend the cd notation to select different implementations of collection classes. Adjust the Demeter code generators. =================================================================== Smalltalk Create Demeter Tools/Smalltalk. Requires 3-4 team members: two for the generic library, one for generate and one for propagate. Use GNU Smalltalk. ================================================================== PROJECT TECHNOLOGY TRANSFER Talk to your manager and convince him/her of the advantages of object-oriented technology (if he/her is not convinced already). Tell him/her that you are willing to do a pilot project using C++ and a powerful tool, called Demeter. Develop a pilot project description with him/her and send me a copy. Do your project and at the end of the quarter, I will give you permission that you can transfer the generated code to your company. Your company can get access to the Demeter Tools/C++ (TM) through Demeter International, Inc. One important goal of the course is to get (adaptive) object-oriented technology used in industry. ================================================================== CORBA PROJECT Apply adaptiveness to distributed computing. For an earlier project, see: /proj/adaptive2/projects/amphion/doc/dd.txt ================================================================== PROJECT: Telecommunication System from: @BOOK{jacobson:oose, TITLE = "Object-Oriented Software Engineering: A use case driven approach", AUTHOR = "Ivar Jacobson and Magnus Christerson and Patrick Jonsson and Gunnar Overgaard", PUBLISHER = "Addison Wesley", YEAR = "1992", SERIES = "", VOLUME = "" } The source code of the previous project is in: /proj/projects/lieber/envs/book/telecom See also: /course/com3360/hw/projects/telecom/ Due the GUI part with Isthmus. ===================================================================== PROJECT: GUI Design and Implementation We have two graphical user-interfaces for drawing class dictionary graphs and the goal is to bring them together into one design. The two programs are: xcddraw (X-Windows, Motif), cdd-dfp program (tcl/tk, Demeter). All are available in source form. The goal is to invent a new object-oriented design which takes the best from all three designs and which makes the design window system independent. The cdd source code is in: /proj/projects/projects/njk/proj You may run /course/com3360/bin/cdd-dfp in any Demeter generated directory. IMPROVE GUI for drawing cd graphs from textual representation using the current implementation of cdd. Improve: currently only small cdgs can be drawn. Properly implement scroll bar and allow for printing of big cds. When a class has been drawn, mark it in menu or remove it from menu. Sort class names in menu. Support parameterized cds. ================================================================== PROPAGATION GRAPH EVOLUTION (GRAPHICAL): Given a class library (A,D) and a new class dictionary D' compatible with A, produce the list of propagation patterns in A for which the propagation graph has changed. Highlight graphically the changes in the propagation graphs. ================================================================ PROPAGATION GRAPH HIGHLIGHTING: Given a cd D and a propagation graph P for D, first draw the cd D and then highlight P in D. ================================================================ PROGRAM MOVIE (Misha Tselman has done this for earlier version of Demeter) PROJECT PROPAGATION PATTERN ANIMATION Given a class library and an executing program, highlight the class whose member function is active. Show a "movie" of the program at the cd and pp level. ================================================================== PROJECT CLASS DICTIONARY/PROPAGATION PATTERN BROWSER To browse a class dictionary and pps and to inspect code attached to the classes. Use Isthmus. PROJECT PROPAGATION PATTERN EVOLUTION Host: Walter Huersch, Linda Keszenheimer Given a cd and a pp and a change to the cd, is the pp affected and how? =================================================================== PROJECT COMMAND LANGUAGE INTERFACE Use tcl/tk to implement a GUI for Demeter. Improve on /course/com3360/bin/vd. Run /course/com3360/bin/vd in any Demeter generated environment. the program in terms of propagation patterns and a class dictionary. Those project descriptions are rather short but I don't have the time to write them out or to explain them, except during class and my 3 office hours per week. Some projects have hosts, but PLEASE make careful use of their time; they are all involved in challenging research projects related to your project. If something is not clear, write your own specification. For some projects you can use the existing tools to get all your questions regarding functionality answered. Once you have selected a project, send me and your host a description of a few paragraphs. Each team needs to send me only one project description. For team projects (2-3 people), include the list of team members and their email addresses. SOURCE CODE from last year projects is in /proj/lieber/com3360 Use in this directory the command more */README-3360 to read the final reports for several of the projects. Your are invited to take those projects and improve them by adding additional functionality or by replacing existing functionality with better functionality. =================================== For last half of the course: o What information do I need on regular basis for on going projects? I would like to be informed about your progress. Especially if you solve problems which are useful to other projects, I would like to be informed. Sometimes, I post your progress to the entire class if I feel that several projects could benefit. o What do you need to hand in at the end of the quarter? What you hand in is all electronic. The description is at the very end. The goal is that the information you hand in will allow other students to build on your projects. You may assume that those students are as educated as you are in object-oriented systems development using class dictionaries and propagation patterns. WHAT TO TURN IN. ================================================ You will almost certainly spend most of your days as a practicing computer professional working in groups. Your effectiveness will depend on your ability to contribute your engineering expertise to those groups. Therefore you had the opportunity in this course (but it was not required) to develop software in groups. You learned about how to bring good members to your group, participating in meetings, partitioning the work etc. To get additional input regarding the grade for your project, I would like you to evaluate your peers. Please answer the following questions in the last week of the quarter, put the answers into an envelope into my mailbox or bring it to class. =============== Project: Your name: Let's assume that the grade for your project is B. Which grade would you give to each of the team members (including yourself)? Why? The evaluation is confidential. It will serve as additional input for assigning a grade. ============= OPEN YOUR FILES FOR READ ACCESS. For the purpose of grading your projects, and saving your assignment code, please use a command such as: chmod -R go+rx xy & for the top directory which contains your project and hw. Make very sure that the top directory itself is accessible to me. --------------------------------------- Include the following information in what you turn in for your project: Put this information into file /proj/adaptive/projects/com3360/YOUR_LOGIN/README-project (if you are in COM 3360) /proj/adaptive/projects/com1205/YOUR_LOGIN/README-project (if you are in COM 1205) and mail a copy to lieber. ---------------------------------------- Your name: Your host: Account Number: Project: (brief description) Directory: (from where we can copy your software for reuse in future projects) Credits: (from where did you reuse some of the software/ideas in your project? reuse is good as long as you give proper credit. Give directory names and name of person from which you used ideas.) file propagate.benefit Class dictionary which you used. Growth plans which you used. Parts of your project which you would have developed further if you had more time. Include a list of known bugs here. (The more bugs you know, the better you have tested your project!) Names of files where test inputs can be found. Names of files where outputs can be found. Include one interesting input/output pair in this file. (well, if your output is graphical, maybe you have some printed form for the graphical information.) Include one interesting input/output pair where the behavior of your program could be improved. Any information which you think is useful to properly reuse your software. Your propagation patterns should contain the following minimal documentation: // brief explanation *operation* void f( Please answer the following questions: Did you change the generated C++ code which make generates from the cd.cd and *.pp files? Did you change the generated Makefile which gen-make produced? I hope not, but if you did, please explain what and why you changed. This is important information for reusing your software. If you had the priviledge to have one of my Ph.D. students as host or if you had interactions with the teaching assistant, an evaluation of their performance would be welcome. ---------------------------------------- More projects: LIBRARY PROJECT A library requires an information system that provides the following on-line operations for library users and staff: 1. Check out (or return) a copy of a book. 2. Get a list of books by a particular author or on a particular subject. 3. Find out what books a particular borrower currently has checked out (users can only look up themselves). 4. Find out which borrower last checked out a particular copy of a book (staff only). 5. Record the addition (or removal) of a copy of a book to (from) the library (staff only). The system must be able to search and update the catalog quickly. It must easily handle updates and corrections by staff users to a potentially large collection. The system must also enforce the following integrity constraints: a. All copies in the library must be available for checkout or be checked out. b. No copy may be both available and checked out at the same time. c. Borrowers cannot have more than a predefined number of books checked out at once. d. Borrowers cannot have more than one copy of a given book checked out at once. Design your system for an object-oriented database. Steps to be done: Design a class dictionary for the library system. e.g. LibrarySystem = List(Book) List(Staff) ... Design a class dictionary for the command language of the library system. e.g. Command: CheckOut | CheckIn | ListInfo | BorrowerInfo | BookInfo. CheckOut = UserName ISBN. Write propagation patterns to implement the command language. Test your propagation patterns by writing ``programs'' in the command language. If time permits, implement the command language using Tcl/Tk. ===================== CALENDAR SCHEDULER Write an object-oriented program, using propagation patterns and class dictionaries, to solve the following problem: The calendar scheduler The calendar scheduler maintains consistent meeting schedules for a number of people. These schedules record at least the time, duration, and participants in each meeting. Some of the meetings may include people whose schedules are not maintained by the calendar scheduler. Meetings may be added or dropped at any time (up to the moment when they occur), and participants to meetings can be added or removed. A meeting may be scheduled at any time which is convenient for all (or enough) of the meeting participants, except that some meetings may need to occur in a particular order. The scheduler may maintain information about the scheduling preferences of the people it serves. Some key considerations affecting the architecture are: Individual flexibility How rich a set of individual preferences can be expressed and accommodated? Heterogeneity: How well are different personal calendar representations handled? (Adaptiveness is useful here since one adaptive program can deal with a wide variety of calendar representations.) Priorities and Conditions: How well can the system resolve conflict when degrees of intensity about preferences can be provided? Ease of use: How easy is it for a person to define and manipulate a set of meetings to attend? How will the information from multiple machines be consolidated? How well are regular meetings handled? Can quorums be defined? Optimality: If there is a schedule, will the system find it? Can scheduling be done in the absence of complete information? =============== Steps to be done: Design a class dictionary for the calendar scheduler. e.g. CalendarScheduler = List(Meeting) List(Meeting) List(PersonalPreference) ... Write propagation patterns to implement the scheduler. ============================================================ PP level error messages Task: Finish this project: ======================= Your name: Kenneth Cain, Dave O'Keefe, Kris Kauper Your host: n/a Account Number: kcain@ccs.neu.edu, daveok@ccs.neu.edu, kkauper@ccs.neu.edu Project: Given the following input object, representing a compile error in generated C++ code from the Demeter System, find the propagation pattern line in error: InputObj = "(" "FILE " < file > DemString ";" "FUNCTION " < func > DemIdent ";" "LINE " < line > DemNumber ")" . The output is of the following form: . If only a function name is given, the entire corresponding propagation pattern is printed. . If only the line number is given, or if both the function name and line number are given, then the output looks like: Wrapper Name: Operation: Code in error: Line # within wrapper code = The output is determined by which information is given in the input object. The filename corresponds to the C++ filename that had a compile time error. This part of the input object *must* be given. At least one of the "func" or "line" parts of the InputObj must be given. This will insure our ability to find the line of wrapper code which is in error. Of course, both parameters may be given. In order to not specify a function name, the function "nil" is used in the input object. For example: (FILE "myfile-DEM.C"; FUNCTION nil; LINE 33) In order to not specify the line number of the C++ filename in error, simply use line number 0: (FILE "myfile-DEM.C"; FUNCTION myfunc; LINE 0) Directory: /proj/projects/projects/kcain Credits: -------- We used the class dictionary of all possible Demeter System inputs. (see below in the "Class dictionary which you used" section) file propagate.benefit ---------------------- SUMMARY ================ The number of characters user-written : 1815 The number of characters generated : 44300 Class dictionary which you used: --------------------------------- We used the class dictionary which describes all possible input objects to the Demeter System. ( /course/com3360/doc/cds/cd-everything ) Growth plans which you used: ---------------------------- The first piece of code that was written was a C function which, given a line number, returned the string found in a C++ file (or any file) at that line. This, we had hoped, we could use right away. However, we did not have sufficient foresight into the overall problem to put this code to use immediately. Then, we tried to solve the following problem: Given: a function name which was deemed to be in error by a C++ compiler a file name in which the function was located. Output: The text of the corresponding propagation pattern in the corresponding .pp file. (converts filename from file-DEM.C to file.pp and prints out the matching operation) This gave us a good start, since we were now comfortable with writing propagation patterns which customize the cd-everything class dictionary. Then, instead of tackling the line number problem, we decided to generalize the problem in terms of an "overall view". This is when we decided to abstract the input object to the system. We knew that there were roughly 3 pieces of information about the C++ generated environment that we needed to know in order to map the error back to a propagation pattern: C++ filename C++ function name Line number within the C++ file which is in error. After abstracting out the components of the input, we could then analyze the different input scenarios that needed to be handled: - A filename must be given - One or two of the (function name, line number) pair must be given. We wrote a propagation pattern which would simply get this InputObj object once it had been parsed in as a Demeter_in object (the universal Demeter input) Problem: We are given all inputs in the input object. Next, the task was to get a line number from the input and to search for the code found on that line in the C++ file as a substring of a propagation pattern wrapper. For this, we used the original function to get a specific line from the C++ file. With this string now in hand, we called a propagation pattern which gets all of the wrapper code in a propagation pattern and searches for this string as a substring in all the wrapper code. The final problem: What if we are given *only* a line number and a file name. For this, it is important to check *all* propagation patterns in the corresponding .pp file, since we don't know in which function the code is located. So, for each propagation pattern encountered in the .pp file, we call the above described propagation pattern. Parts of your project which you would have developed further if you had more time. Include a list of known bugs here. (The more bugs you know, the better you have tested your project!) ------------------------------------------------------------------ 1. We would have added a GUI interface to the software, highlighting the C++ and the propagation pattern code simultaneously. 2. Take input directly from the compiler output. (taking into consideration the output formats of different compilers) Currently, the input syntax is stored in a "demeter-input" file. 3. More intelligent searching for propagation pattern errors. Currently, we only search for errors which may have happened as syntax errors in the wrapper portions of the propagation pattern. Had we more time, we could have looked at the .trv files in a Demeter environment, and looked for subtle errors in propagation, transporation, and traversal graphs which result in erroneus C++ code. Names of files where test inputs can be found. ---------------------------------------------- /proj/projects/projects/kcain/demeter-input Names of files where outputs can be found. ------------------------------------------ /proj/projects/projects/kcain/demeter-output (note that there is nothing wrong with the C++ code that is reported to be in error. We simply used this wrapper code as an example which could have been deemed syntactically incorrect by the C++ compiler) Interesting input/output pair ----------------------------- demeter-input is: (FILE "find_in_allpps-DEM.C"; FUNCTION find_in_allpps ; LINE 0) demeter-output is: Parsing in object in: demeter-input. *operation* int find_in_allpps ( char * line , char * * result ) *traverse* *from* Demeter_in *to-stop* Propagation_pattern *wrapper* Propagation_pattern *prefix* (@ return_val = this->find_line(line, result); @) Since we're only given a function name, our only choice is to print out the entire propagation pattern! ===================================================================