{"id":14070803,"url":"https://github.com/pchemguy/ContactEditor","last_synced_at":"2025-07-30T08:33:14.821Z","repository":{"id":225098313,"uuid":"340746696","full_name":"pchemguy/ContactEditor","owner":"pchemguy","description":"Demo VBA application/template illustrating MVP design pattern backed by persistent storage","archived":false,"fork":false,"pushed_at":"2021-11-06T19:48:00.000Z","size":89779,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-18T00:38:13.141Z","etag":null,"topics":["adodb","database","excel","mvp","oop","persistence","persistent-data","sqlite","vba","vba-excel"],"latest_commit_sha":null,"homepage":"","language":"VBA","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/pchemguy.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":"2021-02-20T20:27:04.000Z","updated_at":"2023-11-06T09:23:00.000Z","dependencies_parsed_at":"2024-02-29T08:51:32.232Z","dependency_job_id":null,"html_url":"https://github.com/pchemguy/ContactEditor","commit_stats":null,"previous_names":["pchemguy/contacteditor"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchemguy%2FContactEditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchemguy%2FContactEditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchemguy%2FContactEditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchemguy%2FContactEditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pchemguy","download_url":"https://codeload.github.com/pchemguy/ContactEditor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215155197,"owners_count":15836926,"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":["adodb","database","excel","mvp","oop","persistence","persistent-data","sqlite","vba","vba-excel"],"created_at":"2024-08-13T07:08:06.258Z","updated_at":"2024-12-04T12:32:42.725Z","avatar_url":"https://github.com/pchemguy.png","language":"VBA","funding_links":[],"categories":["VBA"],"sub_categories":[],"readme":"### Overview\n\n\"Contact Editor\" demos the Model-View-Presenter (MVP) pattern backed by persistent storage (MVP-DB) in VBA. I developed this mock data manager as a VBA OOP course project and an MVP-DB template/prototype for my VBA experiments.\n\n\u003ca name=\"FigDataManagementWorkflows\"\u003e\u003c/a\u003e  \n\u003cimg src=\"https://github.com/pchemguy/ContactEditor/blob/develop/Assets/Diagrams/Overview.svg?raw=true\" alt=\"Overview\" width=\"100%\" /\u003e  \n\u003cp align=\"center\"\u003e\u003cb\u003eFigure 1. Data management workflows.\u003c/b\u003e\u003c/p\u003e  \n\nThe typical data management constituents are shown in [Fig. 1](#FigDataManagementWorkflows). Usually, the user sends a query to the database, receives a response table, browses record data via a user form, and, possibly, updates the database. From the user perspective, the data management process involves three key players: the user, persistent storage, and GUI acting as an intermediary between the first two. Functionally, the actual intermediary is the data manager application responsible for presenting the GUI, maintaining a local data container, and transferring the data (user \u0026#x21D4; GUI \u0026#x21D4; data container \u0026#x21D4; persistent storage), as shown in [Fig. 2](#FigDataManagerApp). The left part of the figure marked with green arrows (\"user \u0026#x21D4; GUI\" and \"GUI \u0026#x21D4; data container\" interactions) can be implemented via the MVP pattern, and the remaining \"data container \u0026#x21D4; persistent storage\" interaction can be handled via a \"storage\" library.\n\n\u003ca name=\"FigDataManagerApp\"\u003e\u003c/a\u003e  \n\u003cimg src=\"https://github.com/pchemguy/ContactEditor/blob/develop/Assets/Diagrams/Data Management Overview.svg?raw=true\" alt=\"Data Management Overview\" width=\"100%\" /\u003e  \n\u003cp align=\"center\"\u003e\u003cb\u003eFigure 2. Data manager application.\u003c/b\u003e\u003c/p\u003e  \n\n### Development environment and repo structure\n\nPrimarily, I use Excel 2002 for development and also run tests on Excel 2016. Contact Editor demo is a VBA app and is part of an Excel Workbook [Contact Editor.xls][Contact Editor] available from the root of this repo. Additionally, all code modules and user forms are available from the [Project][Project] folder (which acts as a container and corresponds to the VBA project root within the .xls file). [Rubber Duck VBA][Rubber Duck VBA] add-in greatly facilitated the development process, and the project structure is exported/imported using the [RDVBA Project Utils][RDVBA Project Utils] VBA module.  The repo includes a sample SQLite database used by one test module. This database is accessed via the \"ADODB\" backend and relies on the [SQLite ODBC driver][SQLite ODBC Orig]. While the tests should pass when the provided driver distribution is used, I compiled the driver myself, as briefly discussed [here][SQLite ODBC], to use an up-to-date SQLite library with all extensions enabled.\n\n### Running the demo with different backends\n\n*ContactEditorRunner.RunContactEditor* is the main entry for the demo.  \n*ContactEditorPresenter.InitializeModel* performs basic backend configuration.  \nThe *DataTableBackEnd* variable found in the entry point sub determines the type of the main storage backend. It can take one of the following values:\n\n- \"Worksheet\" for an Excel Worksheet (demo database [file][ContactEditor.xsv]),\n- \"CSV\" for a text delimited file (demo database [file][Contact Editor]), and\n- \"ADODB\" for a relational database (demo SQLite database [file][ContactEditor.db]).\n\nWhile the \"ADODB\" backend can connect to both \"CSV\" and \"Worksheet\" databases, the dedicated backends should be more efficient.\n\n### Documentation and further information\n\nFor documentation and technical details see project [website][ContactEditor Pages].\n\n### Acknowledgments\n\nA special thanks goes to Mathieu Guindon, a co-founder of the [Rubber Duck VBA][Rubber Duck VBA] project and his [RDVBA blog][RDVBA blog]. RDVBA [blog post][RDVBA No Worksheet] describing a possible approach to abstracting a Worksheet-based persistent storage and a [demo file][RDVBA No Worksheet Demo] helped me jump-start with storage integration. I also followed the [blog post][RDVBA UserForm1.Show] regarding the best practices for UserForm handling and the [SO answer][RDVBA Modeless Form] (and the last comment to that answer) regarding the modeless user forms.\n\n\n[Rubber Duck VBA]: https://rubberduckvba.com\n[RDVBA blog]: https://rubberduckvba.wordpress.com\n[RDVBA No Worksheet]: https://rubberduckvba.wordpress.com/2017/12/08/there-is-no-worksheet\n[RDVBA No Worksheet Demo]: https://rubberduckvba.wordpress.com/2017/12/08/there-is-no-worksheet/#div-comment-286\n[RDVBA UserForm1.Show]: https://rubberduckvba.wordpress.com/2017/10/25/userform1-show\n[RDVBA Modeless Form]: https://stackoverflow.com/questions/47357708/vba-destroy-a-modeless-userform-instance-properly#answer-47358692\n[RDVBA Project Utils]: https://github.com/pchemguy/RDVBA-Project-Utils\n[Overview]: https://github.com/pchemguy/ContactEditor/blob/develop/Assets/Diagrams/Overview.jpg?raw=true\n[Project]: https://github.com/pchemguy/ContactEditor/tree/master/Project\n[Contact Editor]: https://github.com/pchemguy/ContactEditor/blob/master/ContactEditor.xls\n[ContactEditor.db]: https://github.com/pchemguy/ContactEditor/blob/master/ContactEditor.db\n[ContactEditor.xsv]: https://github.com/pchemguy/ContactEditor/blob/master/ContactEditor.xsv\n[ContactEditor Pages]: https://pchemguy.github.io/ContactEditor\n[SQLite ODBC Orig]: http://www.ch-werner.de/sqliteodbc/\n[SQLite ODBC]: https://pchemguy.github.io/SQLite-ICU-MinGW/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchemguy%2FContactEditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpchemguy%2FContactEditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchemguy%2FContactEditor/lists"}