How to Design A Map Class

Hi Folks
I am trying to design a utility class for my Application.
I am having many tables for Id and description
Eg CustomerId CustomerDescription
AccountId AccountDesc
Presntly I am Writing a Class in which there is a method which Returns MAP ID vs Descition for Individual.
But I want to design a class which should have only one Method and depepending upon the Query It should Return The Map of Corresponding Table.
Help Is deeply Appreacited

THx for your answer..
It's my first inherit sample code:
* baseClass.java
package inherit_test;
* @author
public class baseClass {
    /** Creates a new instance of baseClass */
    public baseClass() {
   public void doSomethingWickedAwesomeCOOL(){
      System.out.println("Isn\'t this wicked Awsome COOL!?!");
* extendingClass.java
package inherit_test;
* @author
public class extendingClass extends baseClass{
    /** Creates a new instance of extendingClass */
    public extendingClass() {
    public void doSomethingWickedAwesomeCOOL() {
      System.out.println("This SUCKS!");
* Main.java
package javaapplication1;
* @author
import inherit_test.*;
public class Main {
    /** Creates a new instance of Main */
    public static void inherit_Main(baseClass base) {
        base.doSomethingWickedAwesomeCOOL();
     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
        baseClass base=new baseClass();
        extendingClass extending=new extendingClass();
        inherit_Main(base);
        inherit_Main(extending);
}It's running result:
Isn't this wicked Awsome COOL!?!
This SUCKS!

Similar Messages

  • How to design a mapping with a pre-mapping operator

    Hi,
    I want to design a mapping with only one operator: a pre-mapping operator that uses a procedure with no parameters (so there are no input/output groups). When I validate this mapping I get error VLD-1009: Mapping lines have not been created.
    Question 1: how do I design a mapping if all I want to do is to execute a procedure and there are no target operators involved?
    Question 2: how are pre-mapping process operators intended to be used? (apparently not the way I use one here)
    Jaap.

    One way of doing this is to jus add a constant and a target table to insert a value into a dummy target. (i.e sysdate into dummy_table) This way you can execute the procedure using a pre mapping operator.

  • How to design a client object???

    hello,Michael Wooten
    thank for your help, now I know the list of Java data types for the parameters
    and return values, and their corresponding SOAP data types.
    but how to design a client object, f.e: this object is value Object in ejb, their
    have some gets and sets methods, these set methods, their return type is void
    in java, but now in web service,how to deal with these prolem?
    like ejb, we have ejb's design pattern, for web service, do we have their design
    pattern also?
    thanks :-)

    Hi littlehill,
    In general, you want to think of the input parameters (and return values) for
    a web service method as "hierarchical state", not objects :-)
    The main motivation for taking this approach is to reduce the likelihood of interoperability
    issues with other (noteably non-Java) SOAP packages. The JavaBean model provides
    a simple, easy to implement mechanism for creating "hierarchical state", because
    it allows nesting. Using this nested JavaBean approach, you should be able to
    create an object graph that represents your "value object", but again the key
    here is to not thinking of them (the value objects) as objects, but state ;-)
    Each SOAP (or Web Services) toolkit will have a different approach and API for
    writing SOAP clients, unless it supports JAX-RPC. This being the case, it is a
    bit difficult to come up with an "across the board" design for a web service client
    ;-) In the case of Java-based SOAP toolkits, most developers prefer to "stay in
    the object world" as opposed to dealing with XML parsing APIs. To accommodate
    this desire, most Java-based SOAP toolkits have a "XML-to-Java, Java-to-XML" type
    mapping mechanism to handle the complexities of this task. If you don't want to
    muck around with type mappings, you should look around for a product that can
    generate Java classes from XML Schema, and vis-versa. WLS 7.0 does a better good
    of this than WLS 6.1, so you might want to check it out. I've also had a fair
    amount of success with the Exolab Castor data binding package (http://castor.exolab.org/sourcegen.html).
    It has a very comprehensive implementation of "XML Schema Part 1: Structures"
    and "XML Schema Part 2: Datatypes", is open-source, and works quite well. When
    you get down to it, a good XML Schema processor is key to saving yourself lots
    of frustration and coding.
    Regards,
    Mike Wooten
    "littlehill lee" <[email protected]> wrote:
    >
    hello,Michael Wooten
    thank for your help, now I know the list of Java data types for the parameters
    and return values, and their corresponding SOAP data types.
    but how to design a client object, f.e: this object is value Object in
    ejb, their
    have some gets and sets methods, these set methods, their return type
    is void
    in java, but now in web service,how to deal with these prolem?
    like ejb, we have ejb's design pattern, for web service, do we have their
    design
    pattern also?
    thanks :-)

  • Acces dynamic configuration variable (e.g. filename) in ABAP mapping class

    Hi experts
    I am searching for a possibility to acces a dynamic configuration variable (DCV) in an ABAP mapping class. Since I could not find a solution in SDN and other sources, I hope somebody in this forum can help me.
    What I already found is the following code which can be used to set a DCV, but what I would be interested in is how to read a DCV.
    Any help is appreciated.
    Markus
    METHOD if_mapping~execute.
    DATA l_record type mpp_dynamic.
    * copy payload
    result = source.
    * add an adapter specific attribute
    l_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_record-name = 'FileName'.
    l_record-value = 'test.xml'.
    dynamic_configuration->add_record( l_record ).
    ENDMETHOD.

    Hi Markus,
    you can find everything in my blogs
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    Regards,
    michal

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • From a Technical Architect point of view, how to design a web application?

    Hi to all,
    I am writing this issue here because I this question is not related on how to program, but on how to design a web application. That is, this question is not related to how to program with the technologies in J2EE, but how to use them correctly to achieve a desired outcome.
    Basically I know how to develop a simple web application. I like to use SpringFramework with AcegiSecurity and Hibernate Framework to persist my data. I usually use JBoss to deploy my web applications, however I could easily use Tomcat or Jetty (Since I am not using EJB�s).
    However I have no idea on how to develop (or a better word would be �design�) a website which is divided into different modules.
    Usually when you develop a website, you have certain areas that are public, and other areas that are not. For example, a company would want anyone on the Internet to download information about the products they are selling, however they would only want their employees to download certain restricted information.
    Personally I try to categorise this scenario in to common words; Extranet and Intranet.
    But � (and here starts the confusion in my mind) should I treat these two as two projects, or as one project? The content to be displayed on the Extranet is much different then the content to be displayed on the Intranet and definitely clients should not be allowed to the Intranet.
    First approach would be to treat them as the same project. This would be perfect, since if the company (one day) decides to change the layout of the website, then the design would change for both the Intranet and the Extranet version. Also the system has a common login screen, that is I would only need to have employees to have a certain Role so that they have access to the intranet, while clients would not have a certain Role and thus they would not be allowed in. But what about performance and scalability? What if the Intranet and Extranet have to be deployed on the different Hardware!?
    The second approach is to threat them as two separate projects. To keep the same layout you just copy & paste the layout from one project to another. However we would not want to have two different databases to store our users, one for the employees and the other one for the clients. Therefore we would build a CAS server for authentication purposes. Both the Intranet and the Extranet would use the same CAS server to login however they could be deployed on different hardware. However what if we want to change the design. Do we really want to have to just copy and paste elements from one project to another? We all know how these things finish! �We do not have time for that � just change the Extranet and leave the Intranet as it is!�
    The third approach (and this is the one I like most) is to have a single project built into different WAR files. The common elements would be placed in all WAR files. However in development you would only need to change once and the effects would show in the different war files. The problem with this approach is that the project will be very big. Also, you will still need to define configuration files for each one of them (2 Web.config, 2 Spring-Servlet.config, 2 acegi-security.config, etc).
    Basically I would like something in the middle of approach 2 and approach 3! However I can identify what this approach is. Also I can not understand if there is even a better approach then these three! I always keep in mind that there can always be more then two modules (that is not only Intranet and Extranet).
    Anyways, it is already too long this post. Any comments are more then welcome and appreciated.
    Thanks & Regards,
    Sim085

    Hi to all,
    First of all thanks for the interest shown and for the replies. I do know what MVC or Multi-layered design is and I develop all my websites in that way.
    Basically I have read a lot of books about Domain-Driven Design. I divide my web applications into 4 layers. The first layer is the presentation layer. Then I have the Facade layer and after that I have a Service layer (Sometimes I join these two together if the web application is small enough). Finally I have the Data Access layer where lately I use Hibernate to persist my object in the database.
    I do not have problems to understand how layering a web application works and why it is required. My problem is how to design and develop web applications with different concerns that use same resources. Let me give an example:
    Imagine a Supermarket. The owner of the Supermarket want to sell products from the website, however he wants to also be able to insert new products from the website itself. This means that we have two different websites that make use of the same resources.
    The first website is for the Supermarket clients. The clients can create an account. Then they can view products and order them. From the above description we can see that in our domain model we will have definitely an object Account and an object Product (I am not mentioning all of them). In the Data Access layer we will have repository objects that will be used to persist the Account and Products.
    The second website is for the Supermarket employees. The employees still need to have an account. Also there is still a product object. This means that Account and Product objects are common to the two websites.
    Also important to mention is the style (CSS). The Supermarket owner would like to have the same style for both websites.
    Now I would not like to just copy & paste the objects and elements that are common to both websites into the two different projects since this would mean that I have to always repeat the changes I make in one website, inside the other one.
    Having a single WAR file with both websites is not an option either because I would not like to have to deploy both websites on the same server because of performance and scalability issues.
    Basically so far I have tought of putting the common elements in a Jar File which would be found on the two different servers. However I am not sure if this is the best approach.
    As you can see my problem is not about layering. I know what layering is and agree with both of you on its importance.
    My question is: What is the best approach to have the same resources available for different websites? This includes Class Files, CSS Files, JavaScript Files, etc.
    Thanks & Regards,
    Sim085

  • How to design insertion and report for customers

    I develop a web application in which I provide a web interface for inserting a customer. I model this customer as a class and provide its attributes. I have functions like addCustomer that inserts a customer's details in DB and getDetails() that returns a customer's attributes as an array. I have designed this for dealing with a single customer.
    Now I want to list all customers from DB. I think another class should be created with a listing function that has multiple references(multiplicity) for the customer class. It is a easy task to retrieve all customer using a query and display it. But I don't know how to model this. I don't want to create one object for all available customers and display the details of each customer. Then How to model this and how to implement this using classes.
    Can U tell me a resource or article that handles similar task.
    Thanks.

    Hi,
    Create a POJO called customer ( plain java object which represent the persistant data ) and a Customer manager which is reponsible for retrieving a list of customer.
    So the Customer manager will deal with retrieving the customer list.
    Regards,
    Alan Mehio
    London,UK

  • How to debug ABAP mapping

    Hello
    I've built a ABAP mapping based on How To convert an IDoc-XML structure to a flat file and vice versa in XI 3.0, however it runs into exeception when I tested it in SXI_MAPPING_TEST with error;
    - <cls:CX_SY_NO_HANDLER id="o265">
    - <CX_ROOT>
      <TEXTID>1F09B73915F6B645E10000000A11447B</TEXTID>
      <PREVIOUS href="#o266" />
      <KERNEL_ERRID>UNCAUGHT_EXCEPTION</KERNEL_ERRID>
      <IS_RESUMABLE />
    - <INTERNAL_SOURCE_POS>
      <PROGID>217</PROGID>
      <CONTID>5192</CONTID>
      </INTERNAL_SOURCE_POS>
      </CX_ROOT>
      <CX_NO_CHECK />
    - <CX_SY_NO_HANDLER>
      <CLASSNAME>CX_SY_REF_IS_INITIAL</CLASSNAME>
      </CX_SY_NO_HANDLER>
      </cls:CX_SY_NO_HANDLER>
    I want to debug into the mapping class, someone said jsut set break point in the mapping class and run sxi_mapping_test, then I would be able to debug. However this doesn't work, the execution doesnot stop at the break point (I set session break point, not external break point). Somebody can help?
    Thanks
    Eric

    The trace I got is like:
      <?xml version="1.0" encoding="iso-8859-1" ?>
    - <Top>
      <First>BeginTrace</First>
      <Trace level="1" type="B">CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV</Trace>
      <Trace level="2" type="T">......attachment XI_Context not found</Trace>
      <Trace level="3" type="T">Mapping is determined</Trace>
      <Trace level="1" type="T">Interface Mapping http://mynamespace/xi OM_Order_to_Simple</Trace>
      <Trace level="3" type="T">Object ID of Interface Mapping F1B943B7E3EB382FB1334066F113E0E6</Trace>
      <Trace level="3" type="T">Version ID of Interface Mapping EAA847208A4B11DD96D8F1C80AD60A0B</Trace>
      <Trace level="3" type="T">Mapping Steps 1 R3_ABAP Z_ABAP_MAPPING_IDOC_TO_FLAT</Trace>
      <Trace level="3" type="T">MTOM Attachments are Transferred to the Payload</Trace>
      </Top>

  • How to design CAF Entity service?

    hello,
    here is my question.
    how to design CAF Entity service?
    i got employees data and departments data.
    an employee can join over one department, and of course, a department had many employee.
    in tradition RDBMS(relational database management system), i'll create three tables and named "Employee", "Department" and "DepEmp". the table "DepEmp" is a kind of table for N to N relaction.
    but when i use CAF's entity service, i can't do like RDBMS.
    i can create three entity services, named "Employee", "Department" and "DepEmp". i can make service refence(pull service from left side of windows), but the information about Key(in properties) cannot be "true".
    how can i do?
    is there a different normalization way i have to learn.

    thank you so much, it really help.
    but when the issue more complicated.
    a employee can join multiple departments, and he/she got different job title in each department. case will like fallow.
    Vic is a software engineer in XX company's IT department, and he is a MIS engineer in XX company's HR department.
    the db( i'm sorry for take this for example) structure will like..
    =======================================
    table:employee
    column:
    employeeCode PK
    name
    phone
    table:department
    column:
    departmentCode PK
    name
    location
    table:jobTitle
    column:
    titleCode PK
    name
    description
    table:deptEmployee
    column:
    employeeCode PK FK
    departmentCode PK FK
    titleCode PK FK
    =======================================
    my SAP NetWeaver Developer Studio is version 7.0
    1. how i make sure that three keys be mapped each other?(empCode,deptCode,titleCode)
    2. is there have any "IUD abnormality" risk?
    3. if there have, how can i avoid it?
    thank you again, i'm sorry for ask much, because the way to design CAF Entity Service is that i didn't learn before. it really make me confused.
    have a nice day

  • Use java mapping class on PI 7.0

    Hi experts,
    I have a problem with a java mapping class on PI 7.0, maybe somebody could help me.
    I have a java mapping that call a webservice using AXIS library. If I run on my PC the java mapping is working. I load on Imported Archive the Java mapping class and AXIS librarys. My Java mapping class is compilated by jdk 1.4.2.09, like others java mappings that i have on PI 7.0 system, but when I execute the interface, its returns an error:
    Incompatible class versions (linkage error)
    This error is caused by AXIS Libraries, I use AXIS 1.4 version, and I think that this version is using jdk 1.5 because I read it on some foros. Could somebody confirm it? If it is true, could somebody tell me if there are some AXIS version that use jdk 1.4 or maybe How could I solved it? Thanks.
    Regards,
    Gemma

    Incompatible class versions (linkage error)
    this is usually when the jdk version of XI server and the library version you used to develop the mapping are incompatible. Make sure you use the same version as of the server

  • How to use JAXB generated classes with SOAP

    hello,
    I have a library of JAXB generated classes for my web service. There is a Java class for each web method defined in my schema. For example, my getLocation method is mapped to GetLocation.class.
    However my web service is SOAP based, so I am having to manually strip off the SOAP elements to be able to unmarshall the getLocation xml to a GetLocation class.
    I am noticing a disconnect between JAXB and other Java SOAP and RPC libraries. Does anyone know how to create a JAXB class for SOAP Envelopes and Bodys? Does anyone have any ideas how to incorporate the existing Java web service libraries with JAXB?
    Thanks in advance.

    Have you found a method to integrate SAAJ and JAXB? Or
    is better to use SAAJ only ?If I had to choose I'd go with SAAJ. It seems to me that's theoretically possible to use JAXB classes with SAAJ but I imagine if it is possible it would be a big pain in the ass.

  • How to get ABAP mapping option in Interface Mapping

    Hi
    experts
    How to get ABAP mapping option in Interface Mapping . i need to do abap mapping . i didnt find the option
    plz help me

    Hi,
    If u2018ABAP-classu2019 and u2018XSL(ABAP ENGINE)u2019 does not appear under the u2018Mapping Program Typeu2019 in Interface Mapping, one has to make an additional entry in the Exchange Profile. 
    Only a user with the J2EE security role (administrator) can make the following settings in the Exchange Profile.
    It is achieved in the following manner:
    1) Open http://<host>:<port>/exchangeProfile/index.html
    2)Choose IntegrationBuilder ->IntegrationBuilder.Repository -> com.sap.aii.repository.mapping.additionaltypes
    Add: R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine)
    To check whether the data has been successfully read from the exchange    profile:
    1- Open http://<host>:<port>/rep/support/admin/index.html
    2- Choose Administration of Properties -> All Properties
    3- If the value associated to parameter com.sap.aii.repository.mapping.additionaltypes is not visible, press REFRESH button
    After doing above check in IR, if still don't find the option for ABAP mapping then refresh the cache.
    Award points if useful.

  • How to schedle the mapping in OWB?

    Can any please provide me link to see the steps to schedule the OWB mapping. My version is 11.1.0.7.0. The mapping is developed
    by some one. Now i need to take responsibility on this. I need to know how to schedule the mapping.I want to run this every day mighnight.
    In project explorer, I went into schedules. Then i created the schedule. After that, i am not sure, how to link the mapping on this scheduler.
    any help is highly appreciated.
    thanks.

    Hi ,
    Do you have metalink or my oracle support access ?
    If yes then check Note 444877.1 for OWB mapping or process flow scheduling .
    1. Verify the mapping or process flow completes successfully.
    2. Navigate to the Schedules node in the Design Center Console and create a new Schedules module
    called MY_SCHEDULES. For the location, select your TARGET_LOCATION, as the schedule will be deployed to the database.
    3. Create a new schedule, TEST_SCH, with time greater than current database machine time (server where the job executes).
    4. Associate your schedule with the mapping or process flow. Right click the mapping or process flow and select the option "Configure" and "set Referred Calendar" to TEST_SCH.
    5. In the Control Center Manager, navigate to your TARGET_LOCATION and note the Scheduled Job TEST_SCH_JOB under the Scheduled Jobs node. Deploy the job with action "Create".
    Using SQLPlus logged into the database as the TARGET user, verify the user has a job TEST_SCH_JOB, in state DISABLED:
    select job_name, state from user_scheduler_jobs;
    6. Use the Schedule tab on the Control Center Jobs panel in the Control Center Manager to schedule
    the job. Highlight, right click the job and from the pop-up menu select "start". Use the same query to check the current status:
    select job_name, state from user_scheduler_jobs;
    The above query will show whether the scheduled job is SCHEDULED, RUNNING or SUCCEEDED.
    http://download.oracle.com/docs/cd/E11882_01/owb.112/e10935/scheduling_etl.htm#CHDGEGJF
    Thanks,
    Sutirtha

  • Errors in Map class

    Hello Everyone.
    Well I working on a program that uses Map class and I have some errors.
    They are listed as.
    on line 110
    Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to
    generic type HashMap<K,V> should be parameterized
    line 115
    pe safety: The expression of type Collection needs unchecked conversion to conform to
    Collection<ComputerInvent>
    line 123
    Type mismatch: cannot convert from Object to Computer_listing
    Here is my code is far
    import java.io.*;
    import java.util.*;
    class Computer_listing {
         private String id;
         private String name;
         private Integer harddrive;
         private Integer memory;
         private float speed;
         public Computer_listing(String idx) {
              id = idx;
         }// close the computer_listing loop
          * Constructors.
         public Computer_listing(String cd, String cn, Integer hd, Integer me,
                   float sp) {
              id = cd;
              name = cn;
              harddrive = hd;
              memory = me;
              speed = sp;
         }// close public EmployeeClass
          * accessors make info available
         public String getId() {
              return id;
         public String getName() {
              return name;
         public Integer getHardrive() {
              return harddrive;
         public Integer getMemory() {
              return memory;
         public float getSpeed() {
              return speed;
          * Mutator Methods
         public void setId(String cd) {
              id = cd;
         public void setName(String cn) {
              name = cn;
         public void setHarddrive(Integer hd) {
              harddrive = hd;
         public void setMemory(Integer me) {
              memory = me;
         public void setSpeed(float sp) {
              speed = sp;
    }// close class
    public class ComputerInvent {
         public static void main(String[] args) {
              HashMap hs = new HashMap();
              Scanner kbd = new Scanner(System.in);
              kbd.useDelimiter("\n");
              while (true) {
                   String msg = null;
                   Computer_listing compdb = null;
                   System.out.println("Enter ComputerID - Stop to end");
                   msg = kbd.next();
                   if (msg.equalsIgnoreCase("STOP")) {
                        break;
                   } else {
                        compdb = new Computer_listing(msg);
                   System.out.println("Enter Computer Name");
                   compdb.setId(kbd.next());
                   System.out.println("Enter HardDrive");
                   compdb.setHarddrive(kbd.nextInt());
                   System.out.println("Enter Memory");
                   compdb.setMemory(kbd.nextInt());
                   System.out.println("Enter Speed");
                   compdb.setSpeed(kbd.nextFloat());
                   // add to data structure
                   hs.put(msg, hs); //line 110
              }// close while loop
              System.out.println("Done");
              int i = 1;
              Collection<ComputerInvent> values = hs.values();//line115
              for (ComputerInvent temp : values) {
                   System.out.println("Items are " + i + "" + temp.getClass());
                   i++;
              }// close for loop
              System.out.println("Enter ID to find");
              String findit = kbd.next();
              Computer_listing x = null;
              if ((x = hs.get(findit)) != null) { //line 123
                   System.out.println("Found it");
                   System.out.println("Name is " + x.getClass());
              } else {
                   System.out.println("Did not find it");
              }// close else
         }// close public static void
    }// close public class ComputerInventCan someone please help me in solving this.
    thanks
    sandyR

    The code should have thrown hundreds of errors i wonder how u managed with few
    import java.io.*;
    import java.util.*;
    class Computer_listing {
         private String id;
         private String name;
         private Integer harddrive;
         private Integer memory;
         private float speed;
         public Computer_listing(String idx) {
                  this.id = idx;
         public Computer_listing(String cd, String cn, Integer hd, Integer me,
                   float sp) {
              this.id = cd;
              this.name = cn;
              this.harddrive = hd;
              this.memory = me;
              this.speed = sp;
         public String getId() {
              return this.id;
         public String getName() {
              return this.name;
         public Integer getHardrive() {
              return this.harddrive;
         public Integer getMemory() {
              return this.memory;
         public float getSpeed() {
              return this.speed;
         public void setId(String cd) {
              this.id = cd;
         public void setName(String cn) {
                 this.name = cn;
         public void setHarddrive(Integer hd) {
              this.harddrive = hd;
         public void setMemory(Integer me) {
              this.memory = me;
         public void setSpeed(float sp) {
              this.speed = sp;
    public class ComputerInvent{
      public static void main(String s[]){
             HashMap<String,Computer_listing> hs = new HashMap<String,Computer_listing>();
             Scanner kbd = new Scanner(System.in);
             kbd.useDelimiter("\n");
               while(true){ 
                   String msg = null;
                   Computer_listing compdb = null;
                    System.out.println("Enter <ComputerID> - Type <Stop> to end");
                    msg = kbd.next();
                    if (msg.equalsIgnoreCase("STOP"))
                break;
                     else
                compdb = new Computer_listing(msg);
                    System.out.println("Enter Computer Name:");
              compdb.setId(kbd.next());
              System.out.println("Enter HardDrive:");
              compdb.setHarddrive(kbd.nextInt());
              System.out.println("Enter Memory:");
              compdb.setMemory(kbd.nextInt());
              System.out.println("Enter Clock Speed:");
              compdb.setSpeed(kbd.nextFloat());                
                    hs.put(msg,compdb);
              System.out.println("<Done>");
              Collection<Computer_listing> values = hs.values();
              int i = 0;
              for (Computer_listing temp : values) {
                   System.out.println("Name["+ i + "]:" + temp.getName());
                   i++;
              System.out.println("Enter ID to find");
           String findit = kbd.next();
              Computer_listing x = null;
                 if ((x = hs.get(findit)) != null) {
                   System.out.println("Found it");
                   System.out.println("Name is " + x.getName());
              } else {
                   System.out.println("Did not find it");
    }Hope that works :)
    Anyways i'd advice you learn basics of using java.util Classes first and then go about using generics if you are a starter.
    REGARDS,
    RaHuL

  • How to design this BO?

    This picture shows the result which I want ,however,I don't konw how to design the BO! Can anybody help me ?
    Best Regards!

    Hi,
    Have a main view with 3 viewcontainer ui elements. Have 3 more views, with each control in the view. Have 3 attributes defined in a node of the component controller, one each for the tree selection, ALV selection and button enabling. All these attributes will be of type char01. Map the component controller node to all your view nodes.
    In the click event of the tree, set the first attribute. In the click event of the ALV, set the second attribute. In the wddoinit of the 3rd view, do a get_attribute to see if both the previous attributes are 'X'. Then do a set_attribute of the 3rd one. Bind the 3rd attribute to the 'Enabled' property of the button. By default it will be greyed out.
    But why do you need each control in a separate view? You could very well place them in transparent containers or some other element inside the same view right? From your description, I dont really see a need for separate views.
    Hope this helps.
    Regards,
    Nithya

Maybe you are looking for

  • The Sound On My MacBook Pro Isn't Working

    The sound on my MacBook Pro is usually fine, but today it didn't work. For example, I tried listening to music on iTunes and watch videos but the volume wouldn't work at all. When I go to turn up the volume, it seems to turn up ok, but when I try to

  • Do I need to backup my files when upgrading from tiger to leopard?

    Not sure if I need to backup all my files before upgrading from Tiger to Leopard (to use a Mac Box Set), have bought a Seagate 1TB FreeAgent GoFlex Home hard drive to back up on. Was told I wouldn't need a WiFi router but have now discovered I would

  • Output requirement

    Hi, our system is so designed that the  sales order is confirmed for stock when the materials department confirms the same by means of a Z transaction and by selecting the relevant sales order number. by doing this, a staus is updated in the sales or

  • Eleastic Easing Motion Path ?

    Can anyone point me out how to set an Elastic or Bouncing movement to a motion Path? The only options I see are basic Ease In and Out . I would also like to have Ease In AND Out on the same movement.   THanks in advance.

  • Ipod nano won't charge more than 20% or so

    my 6 mos old nano won't charge more than 20% or so - jsut started this weekend when i ran a half marathon and it ran out of juice before i could get it charged. only time it's ran out of juice. plug it in to everything i have, and can only get 20% ch