Skip to content
Navigation Menu
登录
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
操作
Automate any workflow
代码空间
Instant dev environments
问题
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced 安全
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
市场
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
安全
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub 赞助
Fund open source developers
PROGRAMS
安全 Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced 安全
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
搜索
/
登录
注册
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
premaseem
/
DesignPatternsJava9
Public
通知
You must be signed in to change notification settings
复刻
165
Star
81
Code
问题
0
拉取请求
27
操作
项目
维基
安全 and quality
0
洞察
Additional navigation options
Code
问题
拉取请求
操作
项目
维基
安全 and quality
洞察
Factory Design Pattern
- #28
#28
Open
premaseem
wants to merge 9 commits into
develop
premaseem/DesignPatternsJava9:develop
from
factory
premaseem/DesignPatternsJava9:factory
Copy head branch name to clipboard
Conversation
提交
9
(9)
Checks
Files changed
Open
Factory Design Pattern
#28
premaseem
wants to merge 9 commits into
develop
premaseem/DesignPatternsJava9:develop
from
factory
premaseem/DesignPatternsJava9:factory
Copy head branch name to clipboard
提交
提交 on Jan 31, 2018
Step 1: Factory pattern - Before code ( poor code )
premaseem
committed
8e41ad8
View commit details
Copy full SHA for 8e41ad8
Browse repository at this point
Step 2: Abstract Ice cream interface (Generalize it)
premaseem
committed
f5ca54c
View commit details
Copy full SHA for f5ca54c
Browse repository at this point
Step 3: Create Ice cream factory
premaseem
committed
79d3940
View commit details
Copy full SHA for 79d3940
Browse repository at this point
Step 4: update client and consume factory to make code loosely coupled, reusable and centralized
premaseem
committed
69fa158
View commit details
Copy full SHA for 69fa158
Browse repository at this point
Step 5: Lesson Learnt :-)
premaseem
committed
dfc8e4e
View commit details
Copy full SHA for dfc8e4e
Browse repository at this point
Final touch - converted factory method as static
premaseem
committed
50fc6fd
View commit details
Copy full SHA for 50fc6fd
Browse repository at this point
Bonus Pattern of Pizza factory
premaseem
committed
e29ffd1
View commit details
Copy full SHA for e29ffd1
Browse repository at this point
提交 on Aug 5, 2018
added uml diagram
premaseem
committed
37c4973
View commit details
Copy full SHA for 37c4973
Browse repository at this point
提交 on Aug 8, 2018
update readme.md
premaseem
committed
edc9209
View commit details
Copy full SHA for edc9209
Browse repository at this point
You can’t perform that action at this time.