on 05-26-2004 9:51 AM
Hi all,
i tried to build a J2EE library to "pack" some utility classes together, which should only exist once in the container (generic sorting, filtering of context elements and more). I succeeded finally, but i'm not sure, if this is "legal" anyway or if there's a better way to achieve this. The library looks like this:
1. The classes are contained in one single jar at the moment, just for sake of simplicity. This will change in the future.
2. Since some of the utility classes are referencing WD-classes (like WDRuntimeException) again, an outgoing weak reference to the webdnypro service is defined. The Weak Reference appliance matrix in: http://help.sap.com/saphelp_nw04/helpdata/de/9a/4e4f3e065de946e10000000a114084/content.htm says, this is illegal for a library? On the other hand, there are some libraries like the "Remote Profile Library", which also have outgoing service references.
Here's the provider.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE provider-descriptor SYSTEM "library.provider.dtd">
<provider-descriptor>
<display-name>libtest2</display-name>
<component-name>libtest2</component-name>
<major-version>1</major-version>
<minor-version>0</minor-version>
<micro-version>0</micro-version>
<provider-name>ascoit.de</provider-name>
<references>
<reference
provider-name="engine.sap.com"
strength="weak"
type="service">webdynpro</reference>
</references>
<jars>
<jar-name>asco-it.de~java~test~proj~deploy.jar</jar-name>
</jars>
</provider-descriptor>
Any help is appreciated.
Regards
Stefan
Hi Stefan,
A possible solution would be to package the helper classes as Web Dynpro application, and all other users to reference it.
The problem with having reference from a library to a service can be different, one for example is that all libraries are initialized first during the start of the server (when the Web Dynpro or any other service are not available).
Hope that helps!
Karin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
At my client we did just as Karin suggested and packaged all our helper classes into a Web Dynpro development component. Web Dynpro DC do not need to have any visualization pieces.
The only thing to remember (as I'm sure it has been pointed out elsewhere) is to add the Web Dynpro Sharing Reference to the Web Dynpro DC in the using applications as well as the build time DC reference.
Hope this helps,
--Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karin and Greg,
thank you very much for your input. Building WD DC(s) was my first approach actually, since it's also much easier to handle than a library (regarding redeployment for example).
Regarding the handling of (WD) DCs i'd like to make two suggestions:
1. Adding Sharing (and other) references to Web Dynpro references is a little bit tricky, since i've to enter (and probably mistype) the full DC name manually and have to respect name conventions (sap.com/a/b/c as DC name will be sap.com/abc if deployed for example).
Wouldn't it be possible to add an option (maybe "Add as Reference") to the context menu of an "Used DCs" entry, followed by a dialog asking which kind of reference to add?
2. There's a maximum DC name length restriction of 40 characters. This should be checked on DC creation already, because otherwise this error is not "visible" before deploy time. Since it's not possible to rename a DC, one have to create a new one and transfer all objects to the new DC, which is not really comfortable.
Best regards
Stefan
Hi Stefan,
You assumed it already, this is not "legal". The architecture of the layering is libraries <- services <- applications, and usages in the other direction often lead to troubles. Sometimes we get lifecycle troubles (especially when referencing applications from services) because of this which are hard and time consuming to debug. So it might be turned off eventually.
Best regards,
Karin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karin,
thank you very much. But are there any alternatives to get the outgoing reference to the WD classes then? I wouldn't have used the service reference, if there were a runtime equivalent to the design time build libraries like it's the case for other libs like "com.sap.mw.jco" for example.
Best regards,
Stefan
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.