Pages

Difference Between @Component, @Service and @Repository


http://stackoverflow.com/questions/6827752/whats-the-difference-between-component-repository-service-annotations-in

As many of the answers here states what these annotations are used for, I’m going to point out some minor differences between them.
First the Similarity
First point worth highlighting again is that with respect to scan-auto-detection and dependency injection for BeanDefinition all these annotation (viz., @Component, @Service, @Repository, @Controller) are all the same. You can use one in place of another and can still get your way around.

Differences between @Component, @Repository, @Controller and @Service

@Component
This is a general-purpose stereotype annotation indicating that the class is spring component.
What’s special about @Component
<context:component-scan> only scans @Component and do not looks for @Controller@Service and @Repository in general. They are scanned because they themselves are annotated with @Component.
Just take a look at @Controller@Service and @Repository annotation definition
@Component
public @interface Service {
    ….
}

@Component
public @interface Repository {
    ….
}

@Component
public @interface Controller {
    
}
Thus it’s not wrong to say that @Controller@Service and @Repository are special type of @Component annotation. <context:component-scan> picks them up and registers their following classes as beans, just as if they were annotated with @Component.
They are scanned because they themselves are annotated with @Component annotation. If you define your own custom annotation and annotate it with @Component, then it will also get scanned with <context:component-scan>

@Repository
This is to indicate that the class defines a data repository.
What’s special about @Repository?
In addition to point out that this is an Annotation based Configuration@Repository’s job is to catch Platform specific exceptions and re-throw them as one of Spring’s unified unchecked exception. And for this, we’re provided with PersistenceExceptionTranslationPostProcessor, that we’re required to add in our Spring’s application context like this:
<bean class=”org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor”/>
This bean post processor adds an advisor to any bean that’s annotated with @Repository so that any platform specific exceptions are caught and then rethrown as one of Spring’s unchecked data access exceptions.

@Controller
The @Controller annotation indicates that a particular class serves the role of a controller. The @Controller annotation acts as a stereotype for the annotated class, indicating its role.
What’s special about @Controller?
You cannot switch this annotation with any other like @Service or @Repository, even though they look same. The dispatcher scans the classes annotated with @Controller and detects @RequestMapping annotations within them. You can only use @RequestMapping on @Controller annotated classes.

@Service
@Services hold business logic and call method in repository layer.
What’s special about @Service?
Apart from the fact that it is used to indicate that it's holding the business logic, there’s no noticeable specialty that this annotation provides, but who knows, spring may add some additional exceptional in future.

What else?
Similar to above, in future Spring may choose to add special functionalities for @Service@Controller and @Repository based on their layering conventions. Hence its always a good idea to respect the convention and use them in line with layers.

A Collaborative Study Management System: Pora-lekha.com



Mainly pora-lekha (http://pora-lekha.com) is a collaborative study management system, but it has many other features, too.

Pora-lekha.com is founded with the idea that learning support should be universal, whether you live in a remote village or in a city. Its mission is to provide easily accessible, affordable and ethical education support for students. It connects best and brightest tutors to students: one-to-one, in a group, online or face-to-face.

All students ‘stuck’ sometimes, and working through these barriers is an essential part of learning. So if you need help understanding a concept or working through a problem, pora-lekha.com connects you to tutors and other fellow students online (and offline).

You can connect live to tutors (and fellow students) and ask questions on any subject using online typed chat, voice chat or group discussion.  We connect you to both volunteer and professional tutors. A professional tutor can work through with you one-to-one, helping you understand the subject at a pace that suits you.  Once you are happy and understand the problem, you can log out and continue with your studies until you need help again.

Alternatively, if you're working on an essay (or other things) but would like to get feedback on how to improve it, upload it to a professional (or volunteer) tutor any time of day or night, and they will send it back to you quickly with expert comments on how to make it better.


Features:
1. Online tutoring or face-to-face.
2. Whenever you are stuck and need help: one-to-one, in a group, online or face-to-face.
3. Upload your draft to expert tutors and get awesome feedback quickly. Upload your document any day, any time.
4. Online tutoring: available wherever you have internet access. Connect live with tutors. Get help anywhere, no travel. No appointments required, no minimum session charge - only pay for minutes you use. No commitments - cancel any time. Communicate with your tutor using typed chat: this keeps you anonymous and gives you a written transcript of the session which you can keep.
5. Offline tutoring: available from your local tutors. Pora-lekha.com takes away the hassle of finding a local private tutor.


Frequently Asked Questions (FAQs):
1. How does pora-lekha.com compare with online videos?
Ans: An online video can be useful, but isn’t personalised, and if the understanding and confidence isn’t there already, this option will not prevent struggles in study.

2. Why pora-lekha.com?
Ans: Tutors are not accessible to everyone. Price gets in the way. Your location gets in the way. Even if you need a physics tutor, how do you find a good one, in your area? The night before an exam?
 With pora-lekha.com, the tutors are always a click away. We want to deliver all the benefits of tutoring, to everyone, exactly when it's needed.

2. Why pora-lekha.com offers online tutoring?
Ans: Having a private tutor come to your home has benefits for many families, but online tutoring ahs added flexibility and convenience. With online tutoring you can get help on-demand, in just minutes.  Furthermore it is also great for those students who are daunted by face-to-face tutoring, because the more anonymous environment of online tutoring provides less pressure, embarrassment, or anxiety.

 3. Why do students use pora-lekha.com?
Ans: When you're STUCK on a maths question. When you don't remember how to use the equation you learned in class for your Chemistry homework. When you don't know how to unpack the question to start your assignment or essay. When you keep getting the wrong answer over and over again and don't know WHY. When you're getting frustrated on a question. For a little, quick question. For something BIG and difficult. When you're wasting time on a question. When you are almost there but need a quick reminder because you're stuck on the last part. When you need feedback on your essay introduction, before handing it in. When you have asked mum for help a million times, but she's busy doing other things. When your older brother doesn't have time to help with your chemistry question. When you just know your dad will get frustrated helping with your Physics question. When you ask your friend on Facebook for maths help, but you start procrastinating and talking about other things. And millions more reasons!

5. Who are the verified tutors?
Ans: The best of the best. Our verified tutors are highest quality tutors who are university graduate on specific subjects. All our verified tutors pass extensive screening, testing, and qualification checks to be accepted into our network.

The iFashion

The iFashion is an Australia based Bangladeshi fashion and lifestyle magazine that is published online. The magazine covers international, national and local fashion, beauty trends and news. 

It will continue to introduce its readers to the Bangladeshi fashion and lifestyle. It celebrates people who are iconic in their field of interest. It aims to reach affluent, style-conscious people.


http://theifashion.com