Lab 4

.pdf

School

Toronto Metropolitan University *

*We aren’t endorsed by this school

Course

692

Subject

Industrial Engineering

Date

Apr 3, 2024

Type

pdf

Pages

6

Uploaded by LieutenantSnake2780 on coursehero.com

Electrical, Computer and Biomedical Engineering Page 1 of 6 Software Design and Architecture (COE692) Lab 4 Duration 2 weeks + 1 week for demonstration 1 Group work and Individual submission 2 Objectives The main objectives of this lab are as follows: Design your project based on the microservice architecture Implement microservice using Rest API Implement Frontend and Backend for your project Implement Authentication mechanism using json web token Problem description The first part of the lab asks you to design and implement your usecases based on the microservice architecture. The second part of the lab asks you to implement each microservice by REST API. The third part of the lab asks you to complete the implementation by designing a Frontend and implement authentication mechanism. Requirements The environment that has been set up in Lab 1. A very comprehensive review of Week 8 and Week 9 Lectures. Part 1: Microservice Design In this part, you must name microservices needed for implementing your usecases and describe their role and their relationships in one paragraph. In your description, you need to include the name of database each microsystem uses and the name of its tables. (by your usecases, I mean those usecases you have worked on in Lab2 and Lab 3). For single-member groups that will be one usecase and for the other groups 1 You must upload your files 11:59 pm the day before your demonstration day. 2 Both members of a team must submit all files of the group work before the group deadline. Even though the content of the lab submissions of team-mates are the same, each member must submit all files individually. If two team-members are in different sections (should be handled by the same TA), the group deadline is the latest deadline in the team (e.g., in a group of two members with deadlines of Tuesday and Thursday, the group deadline will be on Thursday).
Page 2 of 6 that will be two usecases. In the following I described microservices needed for Search, Hold, and Borrow usecases. There are four microservices for these three usecases: Frontend: This microservice is responsible to provide GUI for the project, retrieve information from other services, check the login and apply authentication mechanisms. This microservice has Account_LBS database with an Account table. Search: is responsible for searching over books based on book title, and book authors. The database is Search_LBS, which include BOOK, AUTHOR, and BOOK_AUTHOR tables. Borrow: is responsible to provide information about books that have been borrowed by a user, also perform borrowing and returning books. It is related to the Hold microservice, because it needs to check whether a book is on hold or not to decide whether a book can be borrowed. It has Borrow_LBS database with BOOK_BORROW, and BOOK_HOLD tables. Hold: is responsible for retrieving data on whether a book is on hold, and also perform holding a book for a user. It is related to the Borrow microservice, because it needs to check the date a book will be available for holding. It has Hold_LBS database with BOOK_BORROW, and BOOK_HOLD tables. Exercise 1 You need to create a lab report document: The lab report should be prepared using a word processor and should be stored as a single PDF file. This PDF document should be named as follows: TeamMember1Name_ TeamMember2Name_Lab4_exc1.pdf . This is what should be included in your pdf file: 1. The description of your microservices. (20/100) Part 2: implementation 3 In this section, you are supposed to implement your microservices. For single-member teams there must be one frontend and one backend microservice. For other teams there must be at least one frontend and two backend services. In this lab, we are not working on asynchronous messaging between 3 All files related to the developed sample project can be found at D2L>Labs>Lab4Resources
Page 3 of 6 microservices (That will be covered in Lab 5). We just use REST api for synchronise messaging between microservices and getting and sending information. Create a web application for each microservices, following steps you learned in Lab 2 and Lab 3. Employ an architecture style of your choice for implementing microservices. For the library system I used the layered architecture. Figure 1 shows all classes and packages I created for the SearchBooks microservice. Figure 1 As you can see in this figure, there are three packages: persistence package, business package and helper package corresponding to layers in the layered architecture. There is also an extra package, endpoint, which is responsible for handling REST API 4 . BOOK_CRUD is responsible for connecting to Search_LBS and search over books in the database. I created a web page (index.html) for testing Search microservice. Even though this html page is not necessary in the microservice architecture, it is good to test your service before combining them. SearchBusiness performs the main functionalities and convert data requested to XML syntax. BookXML provides basis for marshalling objects to XML 5 . The following shows what I got from the SearchBook microsystem for a query of book related to Anne: 4 Please refer to the lecture notes and lecture videos to learn about creating REST API. 5 Please see lecture notes.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help