Skip to content

Commit 0c59ba6

Browse files
Copilotbrunoborges
andcommitted
Add workflow to create GitHub issues for each enterprise pattern idea from issue #45 comment
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 4a6300e commit 0c59ba6

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Create Enterprise Pattern Issues
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
issues: write
8+
9+
jobs:
10+
create-issues:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Create issues for enterprise pattern ideas
14+
uses: actions/github-script@v7
15+
with:
16+
script: |
17+
const ideas = [
18+
{
19+
title: "Add enterprise pattern: EJB Timer vs Jakarta Scheduler",
20+
body: [
21+
"## Enterprise Pattern: EJB Timer vs Jakarta Scheduler",
22+
"",
23+
"Show the migration from heavyweight EJB `@Schedule`/`TimerService` timers to Jakarta Concurrency's `ManagedScheduledExecutorService`, highlighting reduced boilerplate and better testability.",
24+
"",
25+
"### Suggested slug",
26+
"`enterprise/ejb-timer-vs-jakarta-scheduler`",
27+
"",
28+
"### Notes",
29+
"- **Old approach**: EJB `@Schedule` annotation / `TimerService` injection",
30+
"- **Modern approach**: `ManagedScheduledExecutorService` from Jakarta Concurrency",
31+
"- Highlight: reduced boilerplate, easier unit testing without an EJB container",
32+
"",
33+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
34+
].join("\n")
35+
},
36+
{
37+
title: "Add enterprise pattern: JNDI Lookup vs CDI Injection",
38+
body: [
39+
"## Enterprise Pattern: JNDI Lookup vs CDI Injection",
40+
"",
41+
"Compare the old `InitialContext.lookup()` JNDI pattern with modern CDI injection, demonstrating how container-managed dependencies eliminate fragile string-based resource lookups.",
42+
"",
43+
"### Suggested slug",
44+
"`enterprise/jndi-lookup-vs-cdi-injection`",
45+
"",
46+
"### Notes",
47+
"- **Old approach**: `new InitialContext().lookup(\"java:comp/env/...\")`",
48+
"- **Modern approach**: `@Inject` CDI injection",
49+
"- Highlight: no fragile JNDI name strings, type-safe, container-managed lifecycle",
50+
"",
51+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
52+
].join("\n")
53+
},
54+
{
55+
title: "Add enterprise pattern: Manual JPA Transaction vs Declarative @Transactional",
56+
body: [
57+
"## Enterprise Pattern: Manual JPA Transaction vs Declarative @Transactional",
58+
"",
59+
"Contrast the verbose `em.getTransaction().begin()` / `commit()` / `rollback()` boilerplate with the declarative `@Transactional` annotation, showing how AOP-based transactions reduce error-prone manual lifecycle management.",
60+
"",
61+
"### Suggested slug",
62+
"`enterprise/manual-jpa-transaction-vs-transactional`",
63+
"",
64+
"### Notes",
65+
"- **Old approach**: `EntityTransaction` with explicit begin/commit/rollback in try/catch/finally",
66+
"- **Modern approach**: `@Transactional` from Jakarta Transactions",
67+
"- Highlight: AOP-based, no boilerplate, automatic rollback on exception",
68+
"",
69+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
70+
].join("\n")
71+
},
72+
{
73+
title: "Add enterprise pattern: SOAP Web Services vs Jakarta REST",
74+
body: [
75+
"## Enterprise Pattern: SOAP Web Services vs Jakarta REST",
76+
"",
77+
"Illustrate the shift from heavyweight SOAP endpoints (with WSDL overhead) to clean Jakarta REST resources using `@Path`, `@GET`, and `@POST`, reflecting how modern microservices favour JSON over XML/SOAP.",
78+
"",
79+
"### Suggested slug",
80+
"`enterprise/soap-vs-jakarta-rest`",
81+
"",
82+
"### Notes",
83+
"- **Old approach**: `@WebService` / `@WebMethod` JAX-WS SOAP endpoint with WSDL",
84+
"- **Modern approach**: `@Path` / `@GET` / `@POST` Jakarta REST resource",
85+
"- Highlight: no WSDL, JSON over XML, simpler client consumption, microservices-friendly",
86+
"",
87+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
88+
].join("\n")
89+
},
90+
{
91+
title: "Add enterprise pattern: Message-Driven Bean vs Reactive Messaging",
92+
body: [
93+
"## Enterprise Pattern: Message-Driven Bean vs Reactive Messaging",
94+
"",
95+
"Show how a traditional EJB consuming from a JMS queue compares to a MicroProfile Reactive Messaging method, emphasising the simpler programming model and better cloud-native fit.",
96+
"",
97+
"### Suggested slug",
98+
"`enterprise/mdb-vs-reactive-messaging`",
99+
"",
100+
"### Notes",
101+
"- **Old approach**: `@MessageDriven` EJB implementing `MessageListener.onMessage()`",
102+
"- **Modern approach**: `@Incoming` MicroProfile Reactive Messaging method",
103+
"- Highlight: no EJB container required, simpler model, better cloud-native/Quarkus fit",
104+
"",
105+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
106+
].join("\n")
107+
},
108+
{
109+
title: "Add enterprise pattern: JSF Managed Beans vs CDI Named Beans",
110+
body: [
111+
"## Enterprise Pattern: JSF Managed Beans vs CDI Named Beans",
112+
"",
113+
"Replace `@ManagedBean` (deprecated in Jakarta EE 10) with `@Named` + `@RequestScoped` CDI beans, showing how the unified CDI model eliminates the old JSF-specific lifecycle.",
114+
"",
115+
"### Suggested slug",
116+
"`enterprise/jsf-managed-bean-vs-cdi-named-bean`",
117+
"",
118+
"### Notes",
119+
"- **Old approach**: `@ManagedBean` + `@RequestScoped` from `javax.faces.bean`",
120+
"- **Modern approach**: `@Named` + `@RequestScoped` from CDI (`jakarta.inject` / `jakarta.enterprise.context`)",
121+
"- Highlight: `@ManagedBean` deprecated in Jakarta EE 10, unified CDI lifecycle, works outside JSF",
122+
"",
123+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
124+
].join("\n")
125+
},
126+
{
127+
title: "Add enterprise pattern: Singleton EJB vs CDI Application-Scoped Bean",
128+
body: [
129+
"## Enterprise Pattern: Singleton EJB vs CDI Application-Scoped Bean",
130+
"",
131+
"Contrast a Singleton EJB (with container-managed concurrency and lock annotations) against a plain `@ApplicationScoped` CDI bean, helping developers choose the right tool for shared state.",
132+
"",
133+
"### Suggested slug",
134+
"`enterprise/singleton-ejb-vs-application-scoped`",
135+
"",
136+
"### Notes",
137+
"- **Old approach**: `@Singleton` EJB with `@Lock(LockType.READ)` / `@Lock(LockType.WRITE)`",
138+
"- **Modern approach**: `@ApplicationScoped` CDI bean with explicit `synchronized` or `ReadWriteLock` if needed",
139+
"- Highlight: no EJB container, lighter weight, explicit concurrency control",
140+
"",
141+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
142+
].join("\n")
143+
},
144+
{
145+
title: "Add enterprise pattern: JDBC ResultSet Mapping vs JPA Criteria API",
146+
body: [
147+
"## Enterprise Pattern: JDBC ResultSet Mapping vs JPA Criteria API",
148+
"",
149+
"Move from manual `ResultSet` column-by-column mapping to type-safe JPA Criteria queries, demonstrating how the Criteria API eliminates raw SQL strings and runtime field-mapping errors.",
150+
"",
151+
"### Suggested slug",
152+
"`enterprise/jdbc-resultset-vs-jpa-criteria`",
153+
"",
154+
"### Notes",
155+
"- **Old approach**: `ResultSet.getString(\"column\")` / `ResultSet.getLong(\"id\")` manual mapping",
156+
"- **Modern approach**: `CriteriaBuilder` / `CriteriaQuery` with `Metamodel` for type-safe access",
157+
"- Highlight: no raw SQL strings, compile-time checked field names via metamodel, no runtime mapping errors",
158+
"",
159+
"_Sourced from [#45 ideas comment](https://github.com/javaevolved/javaevolved.github.io/issues/45#issuecomment-3929602375)_"
160+
].join("\n")
161+
}
162+
];
163+
164+
for (const idea of ideas) {
165+
const created = await github.rest.issues.create({
166+
owner: context.repo.owner,
167+
repo: context.repo.repo,
168+
title: idea.title,
169+
body: idea.body,
170+
labels: ["enhancement"]
171+
});
172+
console.log(`Created issue #${created.data.number}: ${idea.title}`);
173+
}

0 commit comments

Comments
 (0)