Design Issue: Localization using Lookup OR Dependency Injection

Hello Forums!
I'm having a design issue regarding localization in my application. I'm using Spring Framework (www.springframework.org) as an
application container, which provides DI (dependency injection) - but the issue is not Spring- but rather design related. All localization
logic is encapsulated in a separate class ("I18nManager"), which basically is just a wrapper around multiple Java ResourceBundles.
Right now localization is performed in the "traditional" look-up style, e.g.
ApplicationContext.getMessage("some.message.key");
where ApplicationContext is a wrapper around the Spring application context and getMessage(...) is a static method on that
context. The advantage of that solution is a clean & simple interface design, localization merely becomes a feature of classes, but
is not part of their public API. The only problem with that approach is the very tight coupling of Classes to the ApplicationContext, which
really is a problem when you want to use code outside of an application context. The importance of this problem increases if one considers
that I18N is a concern that can be found in every application layer, from GUI to business to data tier, all those components suddenly depdend
on an application context being present.
My proposed solution to this problem is a "Localizable" interface, which may provide mutators for an "I18NManager" instance that can be
passed in. But is this really a well-designed solution, as almost any object in an application may be required to implement this interface?
I'm too concerned about performance: the look-up solution does not need to pass references to localizable objects, whereas my proposed solution
will require 1 I18NManager reference per localizable object, which might cause troubles if you let's say load 10.000 POJOs from some database that
are all localizable.
So (finally) my question: how do you handle such design issues? Are there any other solutions out there that I'm not aware of yet? Comments/Help welcome!

michael_schmid wrote:
Hello Forums!
I'm having a design issue regarding localization in my application. I'm using Spring Framework (www.springframework.org) as an
application container, which provides DI (dependency injection) - but the issue is not Spring- but rather design related. All localization
logic is encapsulated in a separate class ("I18nManager"), which basically is just a wrapper around multiple Java ResourceBundles.Why do you think you need a wrapper around resource bundles? Spring does very well with I18N, as well as Java does. What improvement do you think you bring?
Right now localization is performed in the "traditional" look-up style, e.g.
ApplicationContext.getMessage("some.message.key");
where ApplicationContext is a wrapper around the Spring application context and getMessage(...) is a static method on that
context. Now you're wrapping the Spring app context? Oh, brother. Sounds mad to me.
The advantage of that solution is a clean & simple interface design, localization merely becomes a feature of classes, but
is not part of their public API. The only problem with that approach is the very tight coupling of Classes to the ApplicationContext, which
really is a problem when you want to use code outside of an application context. The importance of this problem increases if one considers
that I18N is a concern that can be found in every application layer, from GUI to business to data tier, all those components suddenly depdend
on an application context being present.One man's "tight coupling" is another person's dependency.
I agree that overly tight coupling can be a problem, but sometimes a dependency just can't be helped. They aren't all bad. The only class with no dependencies calls no one and is called by no one. We'd call that a big, fat main class. What good is that?
Personally, I would discourage you from wrapping Spring too much. I doubt that you're improving your life. Better to use Spring straight, the way it was intended. I find that they're much better designers than I am.
My proposed solution to this problem is a "Localizable" interface, which may provide mutators for an "I18NManager" instance that can be
passed in. But is this really a well-designed solution, as almost any object in an application may be required to implement this interface?I would say no.
I'm too concerned about performance: the look-up solution does not need to pass references to localizable objects, whereas my proposed solution
will require 1 I18NManager reference per localizable object, which might cause troubles if you let's say load 10.000 POJOs from some database that
are all localizable.
So (finally) my question: how do you handle such design issues? Are there any other solutions out there that I'm not aware of yet? Comments/Help welcome!I would use the features that are built into Spring and Java until I ran into a problem. It seems to me that you're wrapping your way into a problem and making things more complex than they need to be.
%

Similar Messages

  • When to use @Resource and when to use @EJB for dependency injection

    Hi,
    When do you use
    @Resource and when do you use @EJB for dependency injection?
    Thanks

    Captain obvious: Use @EJB for injection of EJBs, and @Resource for everything else.
    There was a discussion about this very topic quite recently, perhaps you can find it through the search.

  • Design Issue with using MDB

    Lack of timer services with EJB 2.0 dictated our design to implement MDB, since we really needed to use a timeout mechanism for the calling client. Client puts requests into the queue and after processing, the response object messages are put into the response queue owned by the client i.e client configured queue on the JMS server. This model works for the case where the client is a stateless session bean. Now the issue is that we having another client - web application this time, with a servlet pumping requests to the request queue . How do I retain the same model but send queued messages back to the web application? since a response queue cannot be owned by the app. or can it? is there a work around for this scenario..anyone faced a similar situation?

    May be I was not clear enough in my first explanation, Let me try again to explain my scenario:
    My Expectation from Multi Provider is :
    IObjectA
    1AAA
    (From InfoObject)
    Union
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    (From Cube)
    The record in the multiprovider should be :
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    Because, this is what the Union says .. and the Definition of the multiprovider also says the same thing :
    http://help.sap.com/saphelp_bw30b/helpdata/EN/ad/6b023b6069d22ee10000000a11402f/frameset.htm
    Do you still think this is how the behaviour of the multiprovider.. if that is the case what would be the purpose of having an infoobject in the multiprovider.
    Thank you very much in advance for your responses.
    Best Regards.,
    Praveen.

  • What is the use of the setter dependency injection in Spring?

    What is the use of the dependency setter injection ?
    In a database driven app, I retrieve results, use the javabeans set methods to save stuff in javabeans and then call get on it.
    What is the use of having something set externally from a xml already ?
    Can someone provide an example when the setter injection can be used?
    I wouldnt imaginge using it to get usernames, passwords, databaseurl because we use JNDI for that...
    Is the dependency setter meant as something additional to web.xml so you dont have to get params from web.xml?

    No, you would indicate in the XML that the Hibernate object and the TransactionFactory (I am being vague here) have a dependency. You then specify whether you want setter or constructor injection. When Spring creates the Hibernate Object, it will attempt to also create a TransactionFactory and pass that to the Hibernate Object's setter. "Auto-wiring" them together for you.
    - Saish

  • Use INDEXCOL only for localization (without LOOKUP)

    Hi,
    I've to setup data localization in OBIEE 11.
    The manuals say to use LOOKUP and INDEXCOL.
    Anyhow LOOKUP seems not a mandatory step to me.
    Lets say I have to translate a dimension PRODUCTS which at first only have 2 columns: CODE and DESCRIPTION.
    I could add translated columns directly to the physical table like this:
    CODE
    DESC_EN
    DESC_IT
    DESC_ES
    1
    Bike
    Bicicletta
    Bicicleta
    2
    Car
    Auto
    Coche
    3
    Airplane
    Aereo
    Avion
    Then in the Business Model layer I could add a logical column "DESCRIPTION" like this:
    INDEXCOL (VALUEOF(NQ_SESSION.LANGUAGE_INDEX), PRODUCTS.DESC_EN, PRODUCTS.DESC_IT, PRODUCTS.DESC_ES).
    To me these seems easier (no need for extra lookup tables) and faster (no extra join to get the translations).
    Does anybody tried this before?
    Any pitfalls?
    Regards,
      Corrado

    Hello , Welcome to the HP Community! I understand that you are trying to scan on your HP Deskjet F380 All-in-One Printer without having cartridges installed. I'd like to shed a little light on this for you. Some HP printers are able to scan without ink installed, but most do not. If the cartridge lights on the product are blinking and there is an "E" in the copies window, then the printer is in an error state and will not function until cartridges are installed. If the printer is in an error state, that would describe the message you are getting that "An error occured while communicating with the scanning device", as the printer would not respond when prompted by the software. You can check the blinking light combination on the printer and follow the steps in this document to resolve the error state and continue using the device.Blinking Lights on the HP Deskjet F300 All-in-One Printer Series Hope this helps!Thanks so much for posting.

  • Design issue using JFrame, JPanel, JLabel

    I have been working on this problems for several months now and I and nearly finished.
    I have a design question I hope others from this forum can provide some incite to the best approach.
    The problem space is a 8 X 8 Chessboard. I have designed a board using JPanels and JLables sitting inside a JFrame. In each square on the chessboard is a JLabel with an image. The "board" sits in the DEFAULT LAYER of a JLayeredPane. As the user clicks a specific square, a queen is placed in the square (8-queens problem). The only thing I do is swap out the image. All this works well--thanks to several of you from this forum. :-)
    When I add a new queen to the board, the application goes through the evaluation of attack positions. Next, the application should display the new chessboard with only the queens not threaten by other queens. I keep up with the chessboard using an boolean array internally. I build a second boolean array for the new or refreshed chessboard.
    What I want to do is build a second chessboard and "swap" it out with the one in the default layered pane. Can someone be so kind and shine some light on this design issue for me?
    Thank you for taking the time to read my post.

    I don't understand this approach. Swing is by default 'double buffered' and will not flicker. You will get this be default since this is one of the things the Swing painting model gives over AWT.
    You should look at just using JComponent and the paintComponent() method for drawing what you need.
    What I've done in the past is have a simple XML JDoM model. Have components that render themselves based on this model.
    Changing the model then I just issues a call to repaint() at the top level container.
    You can also add and remove items from the parent container. Then issue validate() or repaint(). Can't remember now but I think validate() hits the layout manager logic and then repaints.
    I'm pretty sure the Romain guy posted an example of how to easily draw a background chess board in a panel. ;-)
    The tree concept might really prove useful for a 'gaming tree' approach at the AI also.
    If you look at the Java3D API you will see they use a tree to represent what is rendered and the details about it. Really nice until you change something in the tree that cause the renderer to blow up. ;-)
    I guess the moral is always make small simple changes and test.
    Hope this is helpful.

  • Dependency Injection Problem in EJB 3.0

    Hello.
    I've been trying to get an example of java dependency injection working in JBoss 4.0.5.GA. I've installed it with EJB 3.0 support.
    The problem is that if I try to use the injected resource, I get a null pointer exception.
    The example I'm trying is a very short and simple one. Shouldn't be hard to figure out what is going wrong. Here it goes:
    [root]\src\hello\MessageServlet.java:
    package hello;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.List;
    import java.util.ListIterator;
    import javax.naming.InitialContext;
    import javax.annotation.*;
    public class MessageServlet extends HttpServlet {
         @Resource (mappedName="java:/DefaultDS")
         javax.sql.DataSource ejb30DB;
         public void init () throws ServletException {
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException {
              boolean injectedLookingGood = false;
              boolean notInjectedLookingGood = false;
              try {
                   java.sql.Connection conn = ejb30DB.getConnection();
                   conn.close();
                   injectedLookingGood = true;
              } catch(Exception e) {
                   e.printStackTrace();
              try {
                   InitialContext ic = new InitialContext();
                   javax.sql.DataSource ds = (javax.sql.DataSource)ic.lookup("java:/DefaultDS");
                   java.sql.Connection conn = ds.getConnection();
                   conn.close();
                   notInjectedLookingGood = true;
              } catch(Exception e) {
                   e.printStackTrace();
              response.setContentType("text/html");
              ServletOutputStream out = response.getOutputStream();
              out.println("<html>");
              out.println("<head><title>Hello World</title></head>");
              out.println("<body>");
              out.println("<h1>Hello World</h1>");
              out.println("<form action=\"HelloWorld\" method=\"get\">");
              out.print("Injected DataSource is looking ");
              if(injectedLookingGood) {
                   out.println("good <br>");
              else {
                   out.println("bad <br>");
              out.print("Not-Injected DataSource is looking ");
              if(notInjectedLookingGood) {
                   out.println("good <br/>");
              else {
                   out.println("bad <br/>");
              out.println("<input type=\"submit\" value=\"Test Some More\">");
              out.println("</form>");
              out.println("</body>");
              out.println("</html>");
    [root]\etc\META-INF\web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <display-name>HelloWorldWAR</display-name>
    <servlet>
    <display-name>HelloWorld</display-name>
    <servlet-name>HelloWorldServlet</servlet-name>
    <servlet-class>hello.MessageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/servlet/HelloWorld</url-pattern>
    </servlet-mapping>
    </web-app>
    [root]\etc\META-INF\application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
    <display-name>HelloWorld</display-name>
    <description>Application description</description>
    <module>
    <web>
    <web-uri>web-ejb3.war</web-uri>
    <context-root>HelloWorld</context-root>
    </web>
    </module>
    </application>
    [root]\build.xml:
    <project name="HelloWorld" default="all" basedir=".">
    <!-- Name of project and version -->
    <property name="proj.name" value="HelloWorld"/>
    <property name="proj.version" value="1.0"/>
    <!-- Global properties for thid build -->
    <property name="src.dir" value="${basedir}/src"/>
    <property name="build.dir" value="${basedir}/bin"/>
    <property name="lib.dir" value="${basedir}/lib"/>
    <property name="build.classes.dir" value="${build.dir}/classes"/>
    <property name="build.jar.dir" value="${build.dir}/jar"/>
    <property name="src.etc.dir" value="${basedir}/etc"/>
    <property name="meta-inf.dir" value="${src.etc.dir}/META-INF"/>
    <!-- The build classpath -->
    <path id="build.classpath">
    <fileset dir="${lib.dir}">
    <include name="**/*.jar"/>
    <include name="**/*.zip"/>
    </fileset>
    </path>
    <!-- Useful shortcuts -->
    <patternset id="meta.files">
    <include name="**/*.xml" />
    <include name="**/*.properties"/>
    </patternset>
    <target name="prepare">
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${build.jar.dir}"/>
    </target>
    <target name="compile" depends="prepare">
    <javac destdir="${build.classes.dir}"
    classpathref="build.classpath"
    debug="on">
    <src path="${src.dir}"/>
    </javac>
    </target>
    <target name="package-web" depends="compile">
    <war warfile="${build.dir}/jar/web-ejb3.war"
    webxml="${meta-inf.dir}/web.xml">
    <classes dir="${build.dir}/classes">
    <include name="**/*Servlet.class"/>
    </classes>
    </war>
    </target>
    <!-- Creates an ear file containing the web client war. -->
    <target name="assemble-app">
    <ear destfile="${build.jar.dir}/HelloWorld.ear" appxml="${meta-inf.dir}/application.xml">
    <fileset dir="${build.dir}/jar"
    includes="*.war"/>
    </ear>
    </target>
    <target name="clean">
    <delete dir="${build.dir}" />
    </target>
    <target name="all">
    <antcall target="clean" />
    <antcall target="package-web" />
    <antcall target="assemble-app" />
    </target>
    </project>
    Any help would be apreciated.
    Thanks in advance,
    Hugo Oliveira
    [email protected]

    Hello Ken.
    I gess dependency injection is unnavailable in servlets as of this moment. I conducted another test using a session bean that injects and tests the DataSource and a servlet calling the session bean via a refference obtained from InitialContext. It worked OK.
    Here's the code:
    [root]/src/hello/MessageHandler.java:
    package hello;
    public interface MessageHandler {
         public boolean testInjection();
    [root]/src/hello/MessageHandlerBean.java:
    package hello;
    import javax.ejb.Stateless;
    import javax.persistence.*;
    import java.util.List;
    import javax.annotation.*;
    @Stateless
    public class MessageHandlerBean implements MessageHandler {
         @Resource (mappedName="java:/DefaultDS")
         private javax.sql.DataSource ds;     
         public boolean testInjection() {
              try {
                   java.sql.Connection conn = ds.getConnection();
                   conn.close();
                   return true;
              } catch(Exception e) {
                   e.printStackTrace();
              return false;
    [root]/src/hello/MessageServlet.java:
    package hello;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.List;
    import java.util.ListIterator;
    import javax.naming.InitialContext;
    import javax.annotation.*;
    public class MessageServlet extends HttpServlet {
         public void init () throws ServletException {
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException {
              boolean injectedLookingGood = false;
              try {
                   InitialContext ic = new InitialContext();
                   MessageHandler mh = (MessageHandler)ic.lookup("HelloWorld/MessageHandlerBean/local");
                   injectedLookingGood = mh.testInjection();
              } catch(Exception e) {
                   e.printStackTrace();
              response.setContentType("text/html");
              ServletOutputStream out = response.getOutputStream();
              out.println("<html>");
              out.println("<head><title>Hello World</title></head>");
              out.println("<body>");
              out.println("<h1>Hello World</h1>");
              out.println("<form action=\"HelloWorld\" method=\"get\">");
              out.print("Injected DataSource is looking ");
              if(injectedLookingGood) {
                   out.println("good <br>");
              else {
                   out.println("bad <br>");
              out.println("<input type=\"submit\" value=\"Test Some More\">");
              out.println("</form>");
              out.println("</body>");
              out.println("</html>");
    [root]/etc/META-INF/application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
    <display-name>HelloWorld</display-name>
    <description>Application description</description>
    <module>
    <ejb>HelloWorld.ejb3</ejb>
    </module>
    <module>
    <web>
    <web-uri>web-ejb3.war</web-uri>
    <context-root>HelloWorld</context-root>
    </web>
    </module>
    </application>
    [root]/etc/META-INF/web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>HelloWorldWAR</display-name>
    <servlet>
    <display-name>HelloWorld</display-name>
    <servlet-name>HelloWorldServlet</servlet-name>
    <servlet-class>hello.MessageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/servlet/HelloWorld</url-pattern>
    </servlet-mapping>
    </web-app>
    [root]/build.xml:
    <project name="HelloWorld" default="all" basedir=".">
    <!-- Name of project and version -->
    <property name="proj.name" value="HelloWorld"/>
    <property name="proj.version" value="1.0"/>
    <!-- Global properties for thid build -->
    <property name="src.dir" value="${basedir}/src"/>
    <property name="build.dir" value="${basedir}/bin"/>
    <property name="lib.dir" value="${basedir}/lib"/>
    <property name="build.classes.dir" value="${build.dir}/classes"/>
    <property name="build.jar.dir" value="${build.dir}/jar"/>
    <property name="src.etc.dir" value="${basedir}/etc"/>
    <property name="meta-inf.dir" value="${src.etc.dir}/META-INF"/>
    <!-- The build classpath -->
    <path id="build.classpath">
    <fileset dir="${lib.dir}">
    <include name="**/*.jar"/>
    <include name="**/*.zip"/>
    </fileset>
    </path>
    <!-- Useful shortcuts -->
    <patternset id="meta.files">
    <include name="**/*.xml" />
    <include name="**/*.properties"/>
    </patternset>
    <target name="prepare">
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${build.jar.dir}"/>
    </target>
    <target name="compile" depends="prepare">
    <javac destdir="${build.classes.dir}"
    classpathref="build.classpath"
    debug="on">
    <src path="${src.dir}"/>
    </javac>
    </target>
    <target name="package-ejb" depends="compile">
    <jar jarfile="${build.jar.dir}/HelloWorld.ejb3">
    <fileset dir="${build.classes.dir}">
    <include name="**/*.class"/>
    </fileset>
    <!--
         <metainf dir="${meta-inf.dir}">
    <include name="persistence.xml"/>
    </metainf>
    -->
    </jar>
    </target>
    <target name="package-web" depends="compile">
    <war warfile="${build.dir}/jar/web-ejb3.war"
    webxml="${meta-inf.dir}/web.xml">
    <!--
    <fileset dir="web">
    <include name="**/*"/>
    </fileset>
    -->
    <!--
    <webinf dir="dd/web">
    <include name="jboss-web.xml"/>
    </webinf>
    -->
    <classes dir="${build.dir}/classes">
    <include name="**/*Servlet.class"/>
    </classes>
    </war>
    </target>
    <!-- Creates an ear file containing the ejb jars and the web client war. -->
    <target name="assemble-app">
    <ear destfile="${build.jar.dir}/HelloWorld.ear" appxml="${meta-inf.dir}/application.xml">
    <fileset dir="${build.dir}/jar"
    includes="*.ejb3,*.war"/>
    </ear>
    <!-- <delete file="${build.dir}/jar/web-ejb3.war"/>
    <delete dir="${build.dir}/classes"/> -->
    </target>
    <target name="clean">
    <delete dir="${build.dir}" />
    </target>
    <target name="all">
    <antcall target="clean" />
    <antcall target="package-ejb" />
    <antcall target="package-web" />
    <antcall target="assemble-app" />
    </target>
    </project>
    Thanks,
    Hugo Oliveira
    [email protected]

  • Dependency Injection - JAX-WS / Spring/ WebLogic 10.0.0

    I have an issue with Spring dependency injection not working in WebLogic 10.3.0.
    We are using WebLogic 10.3.2 (11gR1) in our development environment which uses technologies:
    JAX-WS web service and Spring.
    My webservice class extends SpringBeanAutowiringSupport to take care of the class loader issue of JAX-WS and spring because of which Spring dependency injection gets ignored.
    My problem is that our production environment has WebLogic 10.3.0. The same application war file when deployed here, DI gets ignored. Can anyone help me with this?

    Hi to all,
    I'm working with the new WebLogic 10.3 and I've the same problem.
    I can't configure JMS transport with JAX-WS and finally I always have the same problem.
    Have you found the problem (or a link/solution) ?
    Edited by: user7266092 on 04-Mar-2010 01:11

  • ADFc 11g: EJB Dependency injection

    Hello everyone,
    I'm using a managed bean which references a stateless session EJB 3.0:
    public class MyManagedBean {
      @EJB
      private SessionEJB ejb;
    }If the bean is managed by JSF (ie. is registered in faces-config) then the EJB is injected correctly, but if the EJB is managed by ADF (ie. is registered in adfc-config) then there is no dependency injection. Does anybody know why this is so, and if there is a clean solution to the problem?
    Searching the forum, Duncan Mills recommends a bean managed with faces-config in which the EJBs are injected, and then use managed properties to inject those EJBs in the ADF-managed beans.
    Re: Accessing session beans from a managed bean
    Is there a better/simpler solution?
    Thanks!
    Juan Manuel

    Thank you.
    The link helped.
    The one thing i did was created a remote interface for the ejb, which showed up in jndi and then used spring DI to inject a reference to the EJB from jndi.
    Will using a remote interface (instead of a local interface) cause performance issues?

  • Dependency injection and inheritance

    Given:
    class abstract AbstractFoo
    MyObject obj;
    class ConcreteFoo extends AbstractFoo
    Now, I'd like to declare @EJB on "MyObject obj" but AbstractFoo is extended by other subclasses on the client end (outside the container) and so I don't want them to have any EJB3 dependencies. Is there a way for me to declare, inside ConcreteFoo, that "MyObject obj" should have @EJB associated with it?
    Thanks,
    Gili

    Hi Janeth,
    As you can see, Web Dynpro is not a standar JEE container so itu2019s not possible to use dependency injection from a Web Dynpro layer. You have to use JNDI lookups as usually.
    Perhaps the following link may help you: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/605ff5f2-e589-2910-3ead-e558376e6f3d
    You can use EJB Web Dynpro models as an alternative.
    Edited by: Sergi Arrufat on Jun 3, 2008 12:27 PM

  • Design issue  - Historical data - referencial integrity

    Hi,
    I dont know if this is the right place to post this question, but
    I would to like know about the design issues in storing historical data .
    I have a historical table about events ( notifications, alarms, etc ).
    In historical table would I store fields with foreign key to the master table ( device table ) ?
    In this design , how handle then updates ( remove record ) to the master table ?
    would I have a trigger to update the historical table too ? Or I mustn' t permit
    updates in master table primary Keys ?
    And about no store The foreign keys in the historical data ?
    What are the disvantages of this model ?
    Thank you,
    Faria

    Faria,
    The answer depends on why you want historical data.
    Is the historical data to be used for auditing or legal purposes?
    Are you trying to move historical data for performance reasons?
    Is there some other purpose?
    If you're doing this for auditing purposes, I don't recommend using foreign keys since you won't easily be able to capture delete activity.
    I mostly use Designer for all of our designs and typically will turn on server side journaling for this purpose. Designer will then generate the journaling tables and write the triggers to manage the whole process. You don't even need to be a programmer to figure it out.
    Let me know back if this isn't your purpose or you need clarification.
    Thanks, George

  • Dependency inject a EJB 2.x bean with EJB3

    Hi there
    I have an old EJB3 2.x bean deployed on my server, that is registered in JNDI with the name "abc/xyz/ItemLookup_v35".
    Now I wrote a EJB3 SFSB bean and I want to access the old bean using dependency injection. I tried it with the annotation
      @EJB(mappedName = "abc/xyz/ItemLookup_v35")
      private ItemLookupRemote itemRemote;but it wasn't working. How can I explicitly set the JNDI name of an old bean, that I want to lookup for?
    Any help is appreciated!
    Regards,
    Stephan
    Edited by: MasterRefactorer on Jun 27, 2008 7:31 AM

    You can use @EJB to access 2.x Remote views, but the field type has to be the Home interface.
    @EJB(mappedName = "abc/xyz/ItemLookup_v35")
    private ItemLookupHome itemHome;

  • Route Reflectors Design issue

    Hi,
    I am having this design issue with route reflectors and could use some help.
    I have 18 routers fully meshed in an MP-iBGP session and i am going to introduce route reflectors into the network to minimize the total number of TCP sessions
    My problem is that some of these routers have outboud policies with one another. for example i have a route map on router 1 affecting only router 2 and would like to keep it this way
    is there any way to do that through route reflectors ?
    Thank you
    Hadi

    Hi Riccardo,
    I have 18 routers in a full MP-iBGP mesh topology. Some pairs of these routers have the following policy :
    I have a route-map matching on Route Targets and i am setting the next hop to be different from the rest of the RT for that site.
    This way, the prefixes originating from site A for example will reach site B with different next hops depending on how i set it in my route-map.
    These policies are only between pairs of routers i.e. router#1 needs only to affect router#2
    How can i achieve this using RRs
    Thank you
    Hadi

  • Problem in dependency injection with Jboss4.2.1

    Hi,
    I have an application that uses an EJB named -JBejbBean(SLSB)
    which implements a remote interface JBejb.
    I have used JDeveloper 10.1.3 IDE for developing it.
    JBejbBean contains a method
    public String show()
    return "hello";
    Now at the viewController side
    I have a JSF page whose backing bean ---view.backing.Start--- that looks up the above EJB using dependency injection as follows
    @EJB(mappedName="current-ejb-ear/JBejb/remote")
    private JBejb obj;
    this returns an exception that says .....
    Injection on Backing bean failed .
    javax.naming.NameNotFoundException:view.backing.Start not bound.

    Hi All,
    I just got an e-mail from Zinio:
    Hello,
    Thanks for contacting Zinio Customer Support.
    We have fixed the problem that was causing your magazine to appear blue in areas that should not have been blue. We’re very sorry for the inconvenience.
    Thank you,
    Emilia
    Zinio Customer Support
    After removing the bad issues and downloading them again, the problem was fixed, everything looks fine now! Unfortunatly it is not clear how this was fixed, there has been an update of the Zinio app (1.9.3) but the list of updates and fixes did not mention this problem.
    I'm very happy this has been addressed in relatively short time and that this problem in particular didn't need an update of the iOS.
    Hopefully the same will be true for all other apps having this PDF rendering issue.

  • Design issue with the multiprovider

    Design issue with the multiprovider :
    I have the following problem when using my multiprovider.
    The data flow is like this. I have the info-objects IobjectA, IobjectB, IobjectCin my Cube.(Source for this data is s-systemA)
    And from another s-system I am also loading the masterdata for IobjectA
    Now I have created the multiprovider based on the cube and IobjectA.
    However, surprisingly join in not workign in multiprovider correctly.
    Scenario :
    Record from the Cube.
    IObjectA= 1AAA
    IObjectB = 2BBB
    IObjectC = 3CCC
    Records from IobjectA =1AAA.
    I expect the record should be like this :
    IObjectA : IObjectB: IObjectC
    1AAA       :2BBB       :3CCC
    However, I am getting the record like this:
    IObjectA : IObjectB: IObjectC
    1AAA       :2BBB       :3CCC
    1AAA         : #             :#
    In the Identification section I have selected both the entries for IobjectA still I am getting this error.
    My BW Version is 3.0B and the SP is 31.
    Thanks in advance for your suggestion.

    May be I was not clear enough in my first explanation, Let me try again to explain my scenario:
    My Expectation from Multi Provider is :
    IObjectA
    1AAA
    (From InfoObject)
    Union
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    (From Cube)
    The record in the multiprovider should be :
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    Because, this is what the Union says .. and the Definition of the multiprovider also says the same thing :
    http://help.sap.com/saphelp_bw30b/helpdata/EN/ad/6b023b6069d22ee10000000a11402f/frameset.htm
    Do you still think this is how the behaviour of the multiprovider.. if that is the case what would be the purpose of having an infoobject in the multiprovider.
    Thank you very much in advance for your responses.
    Best Regards.,
    Praveen.

Maybe you are looking for

  • Windows Vista Boot camp will not show video card

    Hello Im running a macbook pro in windows vista 32 bit boot camp mode. Every thing works fine except that the device manager only shows the VGA adapter and not the Nvidia Geforce 8600M GT I have equiped. I cant find any drivers for this card. Is ther

  • No accounting document created in MIRO

    Hi, We have an issue as below user posted goods receipt through MIGO, later posted invoice verification through MIRO, but here only material document created.  No accounting document created. Can you please let us know what could be the reasonfor thi

  • Publish Page Content-Cross Site Publishing in SharePoint Online

    Is it possible to get Authoring Site's Specific Page's Content/html content (Live in Page Library of Authoring Site and saved as a Catalog) by a Content Search web part added to the Publishing site's page?  (Please note that these sites created in Sh

  • Can I run I movie on a MacBook Air late 2010 ?

    Can I run imovie on a MacBook like this? Will it run fast? Can I covert videos into the YouTube format "WMV"

  • Unhandled Error in GSM Module

    Hi, When I am  trying to move the Formualation Spec from Final Review to Approved, I am facing Unhandled error. I got the below message from event log.Please find the below error. ErrorType: First| ErrorCount: 0| App: GSM| SessionId: d56508b1-d391-d4