habuma / spring-in-action-4-samples

442 stars 385 forks source link

Sample Code Chapter 4 #8

Open sthzg opened 9 years ago

sthzg commented 9 years ago

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

Sanjay-F commented 9 years ago

+1 wanna know why too.

anthony-cros commented 7 years ago

+1

ghost commented 7 years ago

+1

arcioneo commented 7 years ago

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

AshkinLi commented 7 years ago

+1 Has some example about @DeclareParents ?

ZaynChen commented 6 years ago

` 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 commented 6 years ago

+1

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

aCodeRancher commented 5 years ago

Is chapter 4 example code missing ?