Git Product home page Git Product logo

assignment1_oop's Introduction

Assignment1_OOP

Written by:

  1. Michal Elisha
  2. Shlomit Ashkenazi

In this assignment, we extended the abilities and applications of UndoableStringBuilder (which we have built in the previous assignment):

  1. At the first part we implemented the Observer design as we learned in class
  2. At the second part we debuged and analysed our program using JVM

Getting Started

Rerquirements - IntelliJ enviorment

1.Download our project as ZIP file 2.extract it localy 3.open IntelliJ 3.on the top right press File->new->project from existing sources:

image

4.nevigate to the path to our project folder:

image

  1. press Next on the following:

image image image image image image image

  1. then finally the extraction will end:

image

you can see the project now. (should look like this):

image

Run&Debug: if you are not familiar with IntelliJ: DEBUG - https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html RUN - https://www.jetbrains.com/help/idea/running-applications.html COMPILE - https://www.jetbrains.com/help/idea/compiling-applications.html

Run and Debug Tests:

when you get in the Tests.java class, if you are interested to see the "behind the scences" of a test function , click on the left of the first row of the method and press "debug". in this example, we debugged the concreteMemberTest() method:

  • initialization of two concrete members iinitialize members

  • initialization of g - object of type groupAdmin

    initialize groupAdmin'

  • groupAdmin after registration on the first concrete member

    groupAdmin after registration of one member

  • assert the modify() and update() functions - checking the value of usb of the members

    checking the value of usb of memebers

  • assert the modify() and update() functions and also the undo() function from UndoableStringBuilder class:

    list of members after undo() and modify

Part 1 - Extend UndoableStringBuilder with Observable Design

we have created a UML to explain how we implemented this part:

image

  1. as you can see the 'observer' == 'Member' an interface that's being implemented by ConcreteMember (and therefore the 'update' method is implemented at ConcreteMember - although we didn't state it explicitly in the UML).
  2. by this analogy, 'observable' == 'Sender' an interface that's being implemented by GroupAdmin (also here all methods mentioned at 'Sender' are actually being implemented at 'GroupAdmin').

Part 2 - Testing using JVM

the goal of JVM is to show us how much memory the data structures we use takes, so we can track it and try to optimize the code's efficiency.

the totalsize method on initialized concrete members and the groupAdmin class before the registration shows us the following data:

info_totalsize_initialize

the Footprint method on the groupAdmin class before the registration shows us the following data:

footprint_groupAdmin_pre

the Footprint method on the concrete members after the update (modify() method in groupAdmin ) shows us the following data:

footprint_member

the Footprint method on the groupAdmin class after the update (modify() method in groupAdmin ) shows us the following data:

info_totalsize_foot_groupAdmin

we can see that the list now contains the members, and so the memory allocated for the list and for groupAdmin has increased

*note: in order to use the JVM capabilities, we used Logger as Natan (the teacher) explained to us at his SHEUT KABALA (Link - https://ariel-ac-il.zoom.us/rec/play/DISm8hWeT72rigLJrvBO7qyvMXBhaZOoXEMBSOLd4jmxMoqpF1srWUnfS-MlHVGOznSDSOlv7aA9E44C.8yjo9No50jJwHQWW?continueMode=true&_x_zm_rtaid=2FfKobIHSwW9RPlxRtmiCA.1671577797488.a88248ea7530a8531db2fdeeb2f51028&_x_zm_rhtaid=569 )

main

assignment1_oop's People

Contributors

michalruth avatar slomit1234 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.