Bang Nguyen

Greenhorn
+ Follow
since Feb 03, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bang Nguyen

Hi mates,
Recently I have been looking for Java Hosting. I don't know if this is a good recommendation. Anyway, I found this site: http://www.arvixe.com/tomcat_jsp_java_servlet_hosting
Please suggest if it is a good one!
10 years ago

Sumit Bisht wrote:Bang : Best of Luck!



Thank so much!
11 years ago

Jeanne Boyarsky wrote:Thanks Mark.

Bang: The link Mark refers to is my blog. I took the exam because it comes with the course. I think learning Spring helps your career. I don't think the test does.



Thanks Jeanne!

Actually, I have been studying quite a few frameworks such as Struts v2, .... So when Spring came, it's also my interest to explore it.

Thanks for all your help!
11 years ago
Oh, thanks all for your quick replies!

One more thing I forgot to mention is I live in Australia now. Do you think the Spring Certification can help me in getting a job or advancing my career path or not?

I already got SCJP and SCWCD. The results were quite good. However, I'm struggling for Permanent Visa (PR) here. So I don't know the reason I couldn't get a real job in my interests is because of PR or because I haven't got enough things like this.



Now I'm also working as an IT officer but not up to the level that I expected.

Kind Regards,
11 years ago

Mark Spritzler wrote:

Bang Nguyen wrote:

Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.



Hi, it will not work. Moreover, this is not what we intended to do. Because just imagine the greetingServiceTarget is some JavaBean in our domain such as Student, Class, Course. From that, we can see that those objects must not be singleton. Otherwise, they will store dirty data from the same object type.

When we imagine this greetingServiceTarget as Student, Class Objects; we can see that sometimes we want to lock some specific services of these objects. That's the intention of this example.

Anyway, thanks for your contribution! Please give more suggestions so we can study!



In the scenario of Domain objects, which won't be Spring beans because they hold state, that is where you can go to AspectJ and Bytecode instrumentation to get it done.

Mark



I couldn't upload my files successfully because it's quite big. Please download from this

Please run the class com.bang.helloworld.StandaloneHelloApp only. This project is just for experimenting so forgive me because there are some other irrelevant files there.

When you're running it, please notice this snippet:

GreetingService greetingService =
(GreetingService) factory.getBean("greetingService");
LockMixin lockMixin= (LockMixin) factory.getBean("lockMixin");
lockMixin.lock();
greetingService.sayGreeting();

The expected result is a RuntimeException thrown at line greetingService.sayGreeting()

Thanks for your help!
11 years ago
Hi, I wanna get some Spring certifications. I have no ideas even though I did some googling about this.

I think there is one certification called Spring Professional. In order to get this one, we have to get Spring Core first.

Is it correct?

So, the next thing is how I can prepare for the Spring Core. What kind of test mock can we download and do some before taking the real exams?
11 years ago

Mark Spritzler wrote:I also recommend using the link to the Documentation I posted in that other thread you posted in that got me to this thread.

Those introductions uses Annotations in an Aspect class, that is much nicer loose coupling than having a class extend a Spring class. Now that class is tightly coupled to Spring. Whereas with an Aspect class and annotations on the method to add, you can still run that code as Plain Java code without having anything Spring related in your classpath at runtime.

Thanks

Mark



Thanks! I got your ideas. However, this is just one of the examples. Of cause, when we do this in real life, we can use annotations. I'm also a fan of annotation.

But the idea of this example is to demonstrate the IntroductionInterceptor concept actually doesn't add more attributes or services to the original class. It just gives us a facility to control the behaviour of the services without adding irrelevant stuff into our business actions.

Kind Regards,
11 years ago

Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.



Hi, it will not work. Moreover, this is not what we intended to do. Because just imagine the greetingServiceTarget is some JavaBean in our domain such as Student, Class, Course. From that, we can see that those objects must not be singleton. Otherwise, they will store dirty data from the same object type.

When we imagine this greetingServiceTarget as Student, Class Objects; we can see that sometimes we want to lock some specific services of these objects. That's the intention of this example.

Anyway, thanks for your contribution! Please give more suggestions so we can study!
11 years ago

Mark Spritzler wrote:Actually, you can with Spring AOP.

It is called Introductions, and here is a link to the docs that shows how to do this

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/aop.html#aop-introductions

Mark



Hi, actually I don't believe IntroductionInterceptor can change class dynamically. I think it can intercept and add additional features that the original Java class doesn't have. I posted a question regarding this. Check it out and see if it's your case or not:

How to use IntroductionInterceptor...
11 years ago
Hi, I've started experimenting Spring just for sometimes. Recently I got a strange case with IntroductionInterceptor. I don't know it's my understanding problem or the way I configured the framework was wrong.

Main Idea: I wanted to implement a greeting service which has the method sayGreeting(). Then I added an Introduction Interceptor to control if people can use that service or not.

so as you can see I called the lock() method on the lockMixin but the method was still running smoothly without throwing any RuntimeException.

This is my configuration of hello.xml:

Please pay attention to the bold parts with singleton="true"! I want to try that so I can retrieve back the bean for lockMixin and call the method lock() on it!

Please help me out!
11 years ago
Really appreciate your time if anyone can help me on this! Thank very much!
11 years ago
Hi, I've started experimenting Spring just for sometimes. Recently I got a strange case with IntroductionInterceptor. I don't know it's my understanding problem or the way I configured the framework was wrong.

Main Idea: I wanted to implement a greeting service which has the method sayGreeting(). Then I added an Introduction Interceptor to control if people can use that service or not.



so as you can see I called the lock() method on the lockMixin but the method was still running smoothly without throwing any RuntimeException.

This is my configuration of hello.xml:


Please pay attention to the bold parts with singleton="true"! I want to try that so I can retrieve back the bean for lockMixin and call the method lock() on it!

Please help me out!
11 years ago
can you provide the full bean config xml file? maybe the position of the bean is not suitable.
11 years ago
Hi! I am a new comer. Sorry about this question, since maybe it's not quite related to SCEA. But anyone who has the answers, please share with me. i really appreciate your help.
At first, it might be better for me to introduce about myself a little bit. I have worked in java technologies for 3 years. I got SCJP, SCWCD already. I am preparing for the SCEA exams now. But my problem is i am wondering how to combine business with technologies, because in the future i intend to study more about MBA. However, in my point of view, i still love my job now. i still love java. But it somehow seems to me that it's quite unclear about how to combine MBA which is about business, and management with the knowledge i have been trying my best to study now, i.e. Java. If you have any ideas, please let me know what kind of job i can do in the future, what kind of things i have to do now to prepare for my dream.