This document provides an overview of UML modeling and programming with EMF. It covers topics such as system description, behavioral model, structural model, and model instance. The document also includes use case diagrams, activity diagrams, class diagrams, and object diagrams. The content focuses on the ABC Online Bookshop system.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Running head:UML MODELING AND PROGRAMMING WITH EMF UML Modeling and Programming with EMF Name of the Student Name of the University Author’s auto:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
1UML MODELING AND PROGRAMMING WITH EMF Table of Contents Task 1: System Description:............................................................................................................2 Task 2: Behavioral Model...............................................................................................................3 2.a Use Case Diagram:................................................................................................................3 2.b Activity Diagram:..................................................................................................................4 Task 3: Structural Model.................................................................................................................5 3.a Class Diagram:.......................................................................................................................5 3.b Business Constraints:.............................................................................................................5 3.c Object Diagram:.....................................................................................................................6 Task 4: Model Instance....................................................................................................................6 Bibliography:...................................................................................................................................9
2UML MODELING AND PROGRAMMING WITH EMF Task 1: System Description: TheselectedorganizationisanABCOnlineBookshop.Theorganizationallows customers to purchase books that are available into the system. The organization has mainly customer, admin and publisher and distributor stakeholders. The corporation, small business corporation and sole proprietorship are the business entities of the organization. The use cases are purchase book, make payment, apply discount coupon, add, modify and delete books are the use cases of the system. The main business activities of ABC Online Bookshop are as following. i.Customer purchase books from the online shop ii.Customer login to the system using login credentials iii.Customer register to the system if the customer does not have any valid login credentials iv.The premium customer applying coupon for getting discount v.The admin adding new books into the system vi.The admin deleting books from the system vii.The admin modifying the details of the book available in the system
3UML MODELING AND PROGRAMMING WITH EMF Task 2: Behavioral Model 2.a Use Case Diagram: Figure 1: Use Case Diagram (Source: Created by Author)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
4UML MODELING AND PROGRAMMING WITH EMF 2.b Activity Diagram: Figure 2: Activity Diagram (Source: Created by Author)
5UML MODELING AND PROGRAMMING WITH EMF Task 3: Structural Model 3.a Class Diagram: Figure 3: Class Diagram of ABC Online Book Shop (Source: Created by Author) 3.b Business Constraints: ThefollowingbusinessconstraintsaremainbusinessconstraintsofABCOnline Bookshop. i.Only a valid customer with proper login credentials can purchase books from the shop ii.A specific purchase can be done by only one customer iii.A single payment can be done for each purchase iv.In order to get discount, the premium customer must enter a valid discount coupon code Business ConstraintOCL Aspecificpurchasecontext Purchase inv: Purchase.Customer->size() = 1;
6UML MODELING AND PROGRAMMING WITH EMF can be done by only one customer A single payment can bedoneforeach purchase context Purchase inv: Purchase.Payment ->size() = 1; 3.c Object Diagram: Figure 4: Object Diagram of IT Solution Provider System (Source: Created by Author) Task 4: Model Instance Created a plugin project with name BookShop.instance. Thenthefollowingdependenciesareaddedtoplugin.xml.org.eclipse.emf.ecore, org.eclipse.emf.ecore.xmi and BookShop.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
7UML MODELING AND PROGRAMMING WITH EMF The class for creating the instance is as following. packagede.vogella.emf.webpage.instance; importjava.io.IOException; importjava.util.Collections; importjava.util.Map; importorg.eclipse.emf.common.util.URI; importorg.eclipse.emf.ecore.resource.Resource; importorg.eclipse.emf.ecore.resource.ResourceSet; importorg.eclipse.emf.ecore.resource.impl.requestImpl; importBookShop; publicclassCreateSaveTester { publicstaticvoidmain(String[] args) { BookShop.eINSTANCE.eClass(); BookShop factory = BookShop.eINSTANCE; .setName("index"); .setDescription("BookShop"); .setKeywords("Eclipse, EMF"); .setTitle("Eclipse EMF"); BookShop().add(page); Resource.Factory.Registryreg=Resource.Factory.Registry.INSTANCE; Map<String, Object> m = reg.getExtensionToFactoryMap(); m.put("BookShop",newrequestImpl ()); ResourceSet resSet =newResourceSetImpl(); Resource resource = resSet.createResource(URI .createURI("BookShop/request.website")); pa ge pa ge pa ge pa ge
8UML MODELING AND PROGRAMMING WITH EMF resource.getContents().add(BookShop); try{ resource.save(Collections.EMPTY_MAP); }catch(IOException e) { e.printStackTrace(); } } }
9UML MODELING AND PROGRAMMING WITH EMF Bibliography: Kahani, N., Bagherzadeh, M., Dingel, J. and Cordy, J.R., 2016, October. The problems with Eclipse modeling tools: a topic analysis of Eclipse forums. InProceedings of the ACM/IEEE 19th International Conference on Model Driven Engineering Languages and Systems(pp. 227- 237). ACM. Sunye, G., 2017, July. Model consistency for distributed collaborative modeling. InEuropean Conference on Modelling Foundations and Applications(pp. 197-212). Springer, Cham.