Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample Code Chapter 4 #8

Open
sthzg opened this issue Jul 24, 2015 · 8 comments
Open

Sample Code Chapter 4 #8

sthzg opened this issue Jul 24, 2015 · 8 comments

Comments

@sthzg
Copy link

sthzg commented Jul 24, 2015

Is there a reason why sample code from chapter 4 is not available?

@Sanjay-F
Copy link

+1
wanna know why too.

@anthony-cros
Copy link

+1

1 similar comment
@ghost
Copy link

ghost commented Dec 5, 2016

+1

@arcioneo
Copy link

arcioneo commented Mar 2, 2017

Yeah, I don't know how to finish the example when you use @DeclareParents

@AshkinLi
Copy link

+1
Has some example about @DeclareParents ?

@ZaynChen
Copy link

`
public class DefaultEncoreable implements Encoreable {

@OverRide
public void performEncore() {
System.out.println("encore");
}
}`

`
@aspect
public class EncoreableIntroducer {

@DeclareParents(value = "chapter_4_concert.domain.Performance+", defaultImpl = DefaultEncoreable.class)
public static Encoreable encoreable;
}
using:
@Autowired
private Performance performance;

Encoreable encore = (Encoreable) performance;
encore.performEncore();
assertEquals("encore\n", systemOutRule.getLog());
`
These are my idea about using @DeclareParents.

@yawak
Copy link

yawak commented Mar 11, 2018

+1

Can we have a sample code for chapter 4 that includes test?

hezhii added a commit to hezhii/SpringInActionExamples that referenced this issue Oct 25, 2018
@aCodeRancher
Copy link

Is chapter 4 example code missing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants