Why getService() Method ?

thumbnail
1284716, modified 16 Years ago. Regular Member Posts: 124 Join Date: 9/9/08 Recent Posts
Hi ,

I am using this line of code, it's working fine

School list = SchoolLocalServiceUtil.secretPinValidation(secretPin);


if i am using this line of code, it's also working fine

School list = SchoolLocalServiceUtil.getService().secretPinValidation(secretPin);

I want to know what is the difference b/w with getService() method and without getService() method.



Thanks .............
thumbnail
2189903, modified 16 Years ago. Liferay Master Posts: 677 Join Date: 2/13/09 Recent Posts
Hi.

In most cases there is no difference, generated *Util.method() is just shortcut for *Util.getService().method().

I saw some *Utils' methods that don't follow this structure, but all *Util classes that are generated using ServiceBuilder should call spring service in the same (this) way.