” 写作COMP-533编程、 辅导Java程序语言COMP-533 Model-Driven Software DevelopmentAssignment 1Logging Implementation(25% of final grade)January 27, 2021IntroductionLogging is probably one of the most common recurring development concerns. During development, logging the executionof important operations, or the sending of remote messages, or the modification of state, or the handling of exceptions,can significantly streamline understanding, testing and debugging. Nowadays, many deployed systems also make heavyuse of logging for auditing purpose.The goal of assignment 1 is to Get a feeling of the connection between low-level design models and code (task 1),and then to gain experience in using aspect-oriented technology at the programming level to modularize the loggingfunctionality in a reusable way (tasks 2 and 3). Finally, you are going to demonstrate the reusability of your loggingaspect(s) by submitting some other code of your choice that reuses your logging aspect(s).Task 1: Installing TouchCORE and Java Code GenerationThe goal of task 1 is to use the modelling tool we are going to use in this class called TouchCORE to generate the Javacode of a simple banking application that you are going to modularize using aspects in tasks 2 and 3. There is no hand-inrequired for task 1. Here are the steps: Download TouchCORE (version 7.0.3), the concern-oriented modelling tool used for this assignment from myCourses.To run TouchCORE you need to first install Java 81. Download the BankWithLogging concern from myCourses. Run TouchCORE2. You can edit the Settings.txt file to change the size of the TouchCORE window or togglebetween windowed and full screen mode. This file is read during startup, so any changes you make only take effectwhen you restart the application. Open the BankWithLogging concern. You will see a circular menu in the top right corner of the screen3. Click onthe Open Concern button (button with a folder icon). Then navigate to the BankWithLogging concern folder andselect the BankWithLogging.core file. You will now see the main concern edit screen, with one BankWithLoggingfeature (a white rectangle) in the centre. Click-and-hold on the feature, then select Open Realizing Design Modelfrom the popup menu that appears. This opens the design class diagram of the BankWithLogging application.1You might be lucky and will be able to Run TouchCORE 7.0.3 with more advanced versions of Java, but for instance on Macs (I own severalof them) running Catalina or Big Sur it seems to only run with Java 8. You can install Java 8 from the command line using brew as follows:brew tap AdoptOpenJDK/openjdkbrew install cask adoptopenjdk8On some high resolution Windows systems some students have experienced display problems that were resolved by disabling retina / virtualscaling mode / virtual pixel zoom.If the above does not help, please post your problem in the corresponding discussion group on myCourses.2Type java -jar TouchCORE.jar on the command line, or on some operating systems simply double-click the jar file.3Clicking-and-holding on the center of the menu will display explaining text for each button.1 Optional: You can explore the class diagram (panning is done by right-clicking and dragging on the background).You can look at the behaviour of the public operations of the design classes by click-and-holding on a public operationand then choosing the Go to Message View button (icon that looks like a sequence diagram without *). Hit theBack button (icon that looks like a left arrow) at the top left of the screen to navigate from the sequence diagramback to the class diagram. Generate the Java code. To generate the Java code of the BankWithLogging application, click on the Weave Allbutton (icon that looks like a net) in the circular menu on the top right. This will generate a new class diagramcalled woven_BankWithLogging. Now click on the Generate button (icon that looks like a gear). Select Javafrom the popup menu. Then choose a folder into which you would like to generate the application code. Compile the code, then run it. You should see a simple GUI that allows you to create customers, create accountsfor the customers, and deposit and withdraw money from the accounts. Whenever a customer or account object isinstantiated, or deposit or withdraw is executed, a log message is displayed in the console.Task 2: Install AspectJ and Separating LoggingFor task 2 and 3 you are required to use AspectJ, an aspect-oriented extension of Java. AspectJ is an Eclipse project, butyou dont need to use Eclipse to run AspectJ.For task 2 you are asked to refactor the BankWithLogging Java code. You are to use AspectJ to modularize the loggingfunctionality in such a way that the Account and Customer classes in the end only contain business logic, and do no longermake explicit logging-related calls. The Logging module does not have to be reusable, i.e., the Logging code is allowed todirectly refer to the Account and Customer classes.Make sure that the logging output printed to the console looks exactly like before. When done, keep a copy of yourcode (for submission on myCourses).Task 3: Reusable LoggingFor task 3 you are asked to elaborate a reusable Logging module. It should provide generic logging functionality forrecording constructor executions and operation executions. The Logging module is not allowed to have any dependencieson the Account and Customer classes.Then refactor the BankWithLogging code to use the generic logging module. For this, you need to write a bank-specificcomposition specification that tells the system that you want to log the creation of customers and accounts, as well as thewithdraw and deposit operation executions. You can declare additional aspects to do this, or you can add annotations tothe business classes, if necessary. You are not allowed, though, to make explicit calls from business classes to the genericlogging module.Again, make sure that when you run Your code the logging output printed to the console looks exactly like before.When done, keep a copy of your code (for submission on myCourses).Task 4: Demonstrating ReuseWrite some other Java code (or take some existing Java code you have previously worked on), and configure it to reusethe Logging module you developed in task 3. The application can be super simple. The aim of this task is simply todemonstrate that your Logging concern is indeed reusable. Submit your code together with a readme file that explainshow to compile and run your code from the command line.Hand-InAs discussed in class, there will be 2 phases for this assignment.2Phase 1, due Friday February 5thDuring the first phase, each student works on the assignment tasks 1, 2 and 3 individually. Each student must hand in asolution for task 2 and a solution for task 3 by Friday February 5th 11:59pm. Late hand-ins are not accepted. Please create a folder for task 2 named Task 2 containing the complete code for task 2 (aspect(s) and Java code).Add a readme file explaining how to Compile and run your code from the command line. Create a folder for task 3 named Task 3 containing the complete code for task 3 (aspect(s) and Java code), and areadme file explaining how a user of your Logging module has to customize your reusable module to his needs (i.e.,how to specify the application-specific composition specification). Please also explain how to compile and run yourcode from the command line in the readme file. Compress the two folders into one .zip file and upload it to MyCourses as a submission to assignment 1.Phase 2, due Friday February 12thOnly students who submitted Phase 1 of the assignment will be allowed to participate in phase 2. On Saturday February6th I will form random groups of 6 students from the pool of students that submitted to phase 1. Each student shouldthen present their individual solutions to the group. There will be no class on Monday February 8th. Use that time tomeet your group members and discuss your individual solutions. Your goal is to determine a solution for task 2 and task3 that you will submit as a group by Friday February 12th, 11:59pm. Late hand-ins are not accepted. The solution yousubmit can be one of the initial solutions submitted by an individual student, but you can also take the best ideas fromeach individual solution and come up With a new one that you submit. Additionally, for phase 2, you must also hand ina solution for task 4 (i.e., the small sample application that reuses your generic Logging module you submit for Task 3). Please create a folder for task 2 named Task 2 containing the complete code for task 2 (aspect(s) and Java code).Add a readme file explaining how to compile and run your code from the command line. Create a folder for task 3 named Task 3 containing the complete code for task 3 (aspect(s) and Java code), and areadme file explaining how a user of your Logging module has to customize your reusable module to his needs (i.e.,how to specify the application-specific composition specification). Please also explain how to compile and run yourcode from the command line in the readme file. Create a folder for task 4 containing the complete code for task 4 (aspect(s) and Java code), together with a readmefile explaining how to compile and Run your code from the command line.Compress the 3 folders into one zip file and submit it on MyCourses as a submission to group assignment 1.如有需要,请加QQ:99515681 或WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。