This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155319 - Signal best practices for editing spring xml: avoid imports
Summary: Signal best practices for editing spring xml: avoid imports
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Samaresh Panda
Depends on:
Reported: 2008-12-12 10:25 UTC by masvacaquecarnero
Modified: 2009-02-13 15:53 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description masvacaquecarnero 2008-12-12 10:25:49 UTC
There are a couple of well known best practices when dealing with .xml. Netbeans could warn when these appear.
Netbeans could warn about <import> presence on the .xml as a bad practice

See point 6


6. Prefer assembling bean definitions through ApplicationContext over imports

Like imports in Ant scripts, Spring import elements are useful for assembling modularized bean definitions. For example:

        <import resource="billingServices.xml"/>
        <import resource="shippingServices.xml"/>
        <bean id="orderService"
However, instead of pre-assembling them in the XML configurations using imports, it is more flexible to configure them through the ApplicationContext. 
Using ApplicationContext also makes the XML configurations easy to manage. You can pass an array of bean definitions to the ApplicationContext 
constructor as follows:

    String[] serviceResources =
    ApplicationContext orderServiceContext = new