{"id":23395917,"url":"https://github.com/ghindea/ebanking-app","last_synced_at":"2025-04-08T17:19:45.025Z","repository":{"id":222904654,"uuid":"758695890","full_name":"Ghindea/eBanking-app","owner":"Ghindea","description":"OOP homework","archived":false,"fork":false,"pushed_at":"2024-02-16T21:47:50.000Z","size":178,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T13:39:02.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ghindea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-16T21:34:48.000Z","updated_at":"2024-02-16T22:06:36.000Z","dependencies_parsed_at":"2024-02-16T23:13:45.501Z","dependency_job_id":"1e85e1d2-01d8-4693-9a14-d419d82ed311","html_url":"https://github.com/Ghindea/eBanking-app","commit_stats":null,"previous_names":["ghindea/ebanking-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FeBanking-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FeBanking-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FeBanking-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FeBanking-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghindea","download_url":"https://codeload.github.com/Ghindea/eBanking-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247888568,"owners_count":21013002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-22T07:19:28.208Z","updated_at":"2025-04-08T17:19:45.009Z","avatar_url":"https://github.com/Ghindea.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eBanking App\nHomework realised for OOP course, second year, FACC-CSIT\n\nmade by: [Ghindea Daniel-Teodor](https://github.com/Ghindea)\n\n[requirements](./Proiect%20POO%202024.pdf)\n\n---\n\n### Synopsis:\n\nThis program consists of five main classes that define the properties of the used objects and their functionalities:\n\n- `Main` - the main class that contains methods for loading the data from the input files and for running the program\n- `Bank` - **singleton** class \n  - contains the list of all the users and the list of all the stocks in the system.\n  - contains a hashmap of all exchange rates\n  - contains methods for all functionalities of the bank\n- `User` - **observer** class\n  - class that contains the properties of a user and the methods for the functionalities of the user\n  - contains a list of all the notifications of the user that are received when money are deposited to an account or when a friend transfers money to the user\n  - contains an inner class `UserBuilder` that is used to **build** a user object\n- `Stock` - **subject** class\n  - class that contains the properties of a stock and the methods for the functionalities of the stock\n- `ListPropery` - **strategy** class\n    - used to implement the strategy pattern for the listing of different types of properties of a user (details, portfolio, notifications)\n\n### Chosen designs patterns:\n- [x] Singleton\n- [x] Strategy\n- [x] Builder\n- [x] Observer\n\n### Extra:\nI have implemented this test to check Observer DP:\n```java\npublic void test9() throws IOException {\n        ByteArrayOutputStream outPrintStream = new ByteArrayOutputStream();\n        System.setOut(new PrintStream(outPrintStream));\n        String commandFolder = \"test9/\";\n\n        Main.main(getInputArgs(commandFolder));\n        String output = outPrintStream.toString();\n\n        assertJsonLineAreEqual(output, commandFolder);\n\n        System.setOut(System.out);\n    }\n```\nwith the following input:\n```\nCREATE USER bob.stucky@email.com Bob Stucky 687 Swanson Dr. New York NY 10024\nLIST USER bob.stucky@email.com\nADD ACCOUNT bob.stucky@email.com USD\nADD MONEY bob.stucky@email.com USD 50000\nCREATE USER daniel.ghindea@gmail.com Daniel Ghindea Str.Politemnistului 1 Bucuresti Romania\nADD ACCOUNT daniel.ghindea@gmail.com USD\nADD MONEY daniel.ghindea@gmail.com USD 100000\nADD FRIEND daniel.ghindea@gmail.com bob.stucky@email.com\nTRANSFER MONEY bob.stucky@email.com daniel.ghindea@gmail.com USD 5000\nLIST USER daniel.ghindea@gmail.com\nLIST NOTIFICATIONS daniel.ghindea@gmail.com\n```\n\n### Encountered problems:\nBefore I came up with the idea of implementing Strategy DP I have encountered this situation:\n```java\npublic void listUser(String[] command) throws UserNotFoundException{\n        /*\n         * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n         * I thought that tests don't contain invalid users, and when I wanted to make sure InteliJ\n         * suggested to use AtomicReference, so I did it, but that raised me questions about lambdas.\n         *\n         * -\u003e how the process of using variables from outside the lambda expression works? (o_O)?\n         * -\u003e what is functional programming?\n         * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n         */\n\n        AtomicReference\u003cBoolean\u003e ok = new AtomicReference\u003c\u003e(false);\n        users.forEach(user -\u003e {\n            if(user.getEmail().equals(command[2])) {\n                System.out.println(user); ok.set(true);\n            }\n        });\n        if(!ok.get()) throw new UserNotFoundException(command[2]);\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghindea%2Febanking-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghindea%2Febanking-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghindea%2Febanking-app/lists"}