Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Manish Kumar Jaiswal
September 26, 2012 1:33 AM

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 144

Join Date: November 25, 2008

Recent Posts

Is it a good idea to make a big service.xml having lot of entities or its better we should break it into multiple smaller service.xml .Of-course all entities are not completely related .

Jignesh Vachhani
RE: Service.xml
September 26, 2012 6:00 AM

Jignesh Vachhani

Rank: Liferay Master

Posts: 801

Join Date: March 10, 2008

Recent Posts

Depends on your requirement.
if module is completely separate then I would prefer you to create seprate service.xml.
which can help to build with less building time and can not have lengthy code under single package.
And if you want to reuse service of one portlet to another then better you make it under single service.xml file so that you can easily access services vice-versa.
That's my observation during my development phase.
David H Nebinger
RE: Service.xml
September 26, 2012 5:51 AM

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 13222

Join Date: September 1, 2006

Recent Posts


What he's talking about is one service.xml that imports the stub service.xml files; end result is the same, one plugin with all of the services contained.

That said, we ran into some issues using separate service.xml files under the 6.0 series and reverted back to a single service.xml The single file is large and takes awhile to build the services for, but it works. Do yourself a favor and document it as you would any java source file, as comments always come in handy later on.

If the separate service.xml option was working, I definitely would have gone down that road. Allows the entities to be grouped together based upon function and would keep the file sizes manageable.

So I'd say go that route, but test it out and ensure it works before getting too far down the rabbit hole...

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!