Skip to content

Commit 1b1ed83

Browse files
committed
adding examples for chapters 1 and chapter 2 of Spring 5 Design Patterns
0 parents  commit 1b1ed83

File tree

639 files changed

+32971
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

639 files changed

+32971
-0
lines changed

.metadata/.lock

Whitespace-only changes.

.metadata/.log

Lines changed: 3007 additions & 0 deletions
Large diffs are not rendered by default.
560 Bytes
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.packt.patterninspring.chapter2.decorator.pattern;
2+
3+
/**
4+
* @author Dinesh.Rajput
5+
*
6+
*/
7+
public class SeniorCitizen extends AccountDecorator {
8+
9+
Account account;
10+
11+
public SeniorCitizen(Account account) {
12+
super();
13+
this.account = account;
14+
}
15+
16+
@Override
17+
public String getTotalBenifits() {
18+
return "";
19+
}
20+
21+
@Override
22+
String applyOtherBenifits() {
23+
return "Provide free medical insurance for Senior Citizen";
24+
}
25+
26+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.packt.patterninspring.chapter2.decorator.pattern;
2+
3+
public interface Account {
4+
static final String accountDescription;
5+
6+
String getTotalBenifits();
7+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.packt.patterninspring.chapter2.decorator.pattern;
2+
3+
/**
4+
* @author Dinesh.Rajput
5+
*
6+
*/
7+
public class SeniorCitizen extends AccountDecorator {
8+
9+
Account account;
10+
11+
public SeniorCitizen(Account account) {
12+
super();
13+
this.account = account;
14+
}
15+
16+
@Override
17+
public String getTotalBenifits() {
18+
return "";
19+
}
20+
21+
@Override
22+
String applyOtherBenifits() {
23+
return "Provide free insurance of up to $1,600 for Senior Citizen";
24+
}
25+
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.packt.patterninspring.chapter2.decorator.pattern;
2+
3+
/**
4+
* @author Dinesh.Rajput
5+
*
6+
*/
7+
public class Privilege extends AccountDecorator {
8+
9+
@Override
10+
public String getTotalBenifits() {
11+
return null;
12+
}
13+
14+
@Override
15+
void applyOtherBenifits() {
16+
17+
}
18+
19+
}

.metadata/.plugins/org.eclipse.core.resources/.history/13/10327caeb84b001710e0bef26f2e23cc

Whitespace-only changes.

.metadata/.plugins/org.eclipse.core.resources/.history/13/10e3155edd4a00171ef2ee7c083d60a8

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
*
3+
*/
4+
package com.packt.patterninspring.chapter2.proxy.pattern;
5+
6+
/**
7+
* @author Dinesh.Rajput
8+
*
9+
*/
10+
public class ProxyAccount {
11+
12+
}

0 commit comments

Comments
 (0)