{"id":27125341,"url":"https://github.com/piamacalanda/softeng2_visitor-pattern-ecommerce","last_synced_at":"2026-07-15T14:01:44.441Z","repository":{"id":282673583,"uuid":"949284288","full_name":"PiaMacalanda/SoftEng2_Visitor-Pattern-Ecommerce","owner":"PiaMacalanda","description":"Simple program implements a Visitor Design Pattern to calculate shipping costs for different types of furniture in an e-commerce platform.","archived":false,"fork":false,"pushed_at":"2025-03-16T10:29:57.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T14:42:27.248Z","etag":null,"topics":["visitor-design-pattern"],"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/PiaMacalanda.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-16T04:59:22.000Z","updated_at":"2025-03-16T10:30:31.000Z","dependencies_parsed_at":"2025-03-16T10:15:21.643Z","dependency_job_id":"0a69111c-4b15-4304-ace4-aebf22f18ccc","html_url":"https://github.com/PiaMacalanda/SoftEng2_Visitor-Pattern-Ecommerce","commit_stats":null,"previous_names":["piamacalanda/softeng2_visitor-pattern-ecommerce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PiaMacalanda/SoftEng2_Visitor-Pattern-Ecommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_Visitor-Pattern-Ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_Visitor-Pattern-Ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_Visitor-Pattern-Ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_Visitor-Pattern-Ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PiaMacalanda","download_url":"https://codeload.github.com/PiaMacalanda/SoftEng2_Visitor-Pattern-Ecommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_Visitor-Pattern-Ecommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35507793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-15T02:00:06.706Z","response_time":131,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["visitor-design-pattern"],"created_at":"2025-04-07T14:52:50.249Z","updated_at":"2026-07-15T14:01:44.415Z","avatar_url":"https://github.com/PiaMacalanda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ecommerce Shipping Calculator (Visitor Pattern)\n\n## Overview\nThis simple program implements a **Visitor Design Pattern** to calculate shipping costs for different types of furniture in an e-commerce platform. By using this pattern, we ensure flexibility in adding new furniture types without modifying existing classes, promoting **loose coupling** and **extensibility**.\n\n## Problem Scenario\nYou are a software developer working on an e-commerce platform that sells various types of furniture, including **chairs, tables, and sofas**. The platform requires a **shipping cost calculator** that considers the type and size of the furniture.\n\nEach furniture type has its own **unique shipping cost calculation logic**:\n- **Chairs**: Lightweight and have a flat shipping rate.\n- **Tables**: Medium-sized and incur a weight-based cost.\n- **Sofas**: Bulky and require a distance-based shipping calculation.\n\nEmbedding the shipping logic within each furniture class would lead to **tight coupling**, making it difficult to add new furniture types in the future. Instead, we use the **Visitor Pattern** to separate the shipping cost logic from the furniture objects.\n\n## Implementation Details\n- The project demonstrates the **Visitor Design Pattern** by defining:\n  - **Element Interface**: Represents different types of furniture.\n  - **Concrete Elements**: Implements specific furniture types (Chair, Table, Sofa, etc.).\n  - **Visitor Interface**: Defines the `visit()` method for handling different furniture types.\n  - **Concrete Visitor**: Implements the shipping cost calculation logic for each furniture type.\n  - **Client Code**: Demonstrates how to calculate shipping costs using the visitor pattern.\n\n- **Important Constraints**:\n  - **Do not use abstract classes**.\n  - **Use meaningful interface and class names**.\n  \n## UML Diagram\n![Image](https://github.com/user-attachments/assets/b01ffdae-b2b3-42e5-bf44-7c96c3947f7d)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiamacalanda%2Fsofteng2_visitor-pattern-ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiamacalanda%2Fsofteng2_visitor-pattern-ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiamacalanda%2Fsofteng2_visitor-pattern-ecommerce/lists"}