Forums

Home » Liferay Portal » English » 3. Development

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

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 133

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 .

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

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

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
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6537

Join Date: September 1, 2006

Recent Posts

Wrong.

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...