Model view architecture

I aint good in programming ,but i realised i designed a system without incorporating the mvc.
is my system bad now?

Define "bad" ...
It didn't magically get worse when you found out about MVC - on the other hand if it's not using that sort of separation of concerns it may be less maintainable than it might otherwise have been.
In the short term however, as long as it works ok, I would worry more about commenting design and implementation decisions in your code than trying to refactor it.

Similar Messages

  • Model 2 architecture only works with forms?

    Hi,
    I want to implement model 2 architecture for my application i have model as java classes, Controller the servlet and JSP the view.
    I want to know if this architecture is only for forms?.
    I want to implement for a event like when a hyper link is clicked then some method in my Java class is invoked and the result displayed on JSP.
    Can this be implemented using model 2 architecture ?
    Thank you.

    I want to know if this architecture is only for forms?.Forms are irrelevant.
    They just provide a way to enter and submit parameters from the user.
    You can just as easily use hyperlinks with parameters encoded on the URL. The server side handling for retrieving parameters remains the same: request.getParameter().
    However there are a couple of limitations because Hyperlinks can only use HTTP "GET", where forms can use HTTP "POST" as well.
    - parameters will be visible in the address bar
    - you have a limitation on a length of the parameters (Post doesn't have this limitation)
    The Model2 architecture is completely independant of whether you use get or post to submit your parameters. What makes it model2/mvc as opposed to model1 is that you run through a servlet layer, rather than doing absolutely everything in JSPs
    Cheers,
    evnafets

  • Using model 1 Architecture for inserting row into DB...

    The question is on the design of a JSP using Model 1 architecture.
    I have a html form with 3 fields taking input from user. I have made a java bean with 3 instance varibales in the name of the field names and with getter() setter() methods too.
    I dont want to hardcode the database access in the JSP. How do i acheive modularity or make use of object orientation concepts in the JSP to open aconnection and save the record into a database.
    I dont want the conventional way of harcoding like registering DriverManager... Creating Statement opject and OPening Connection...... and with Statement object to call executeUpdate() method...
    These all should be encapsulated in class and methods so that my JSP looks simple......
    Java Gurus, How do i get going.........

    Untill now, I have motsly written java web applications merely showing information; there's no insert or update available. nevertheless, the design pattern MVC or Model-View-Controller can work just as good for display-only web apps as for the rest.
    You're right if you don't want to have the database connection inside your JSP's. So how do you have to deal with it. The letters MVC already tell a part of the story. You have 3 kinds of objects :
    - Model : the so-called Java Beans; these objects refer to the concepts known to the usezr of the web app, like Client, Product, Order, Orderline, Invoice, Payment
    - View : these are the JSP's
    - Controller : this is the heart of the web app; Java uses the servlets to be the controller.
    But there's another kind of object you will need, namely the DAO or Data Access Object. These objects define the contact with the database, contain the SQL-statements and make objects of the Model type.
    I'll give 2 examples. The first is the GeneralDao which you define just once. This GeneralDao contains the database driver you're using.
    /** Java class "GeneralDao.java" generated from Poseidon for UML.
    * Poseidon for UML is developed by Gentleware.
    * Generated with velocity template engine.
    package org.gertcuppens.dao;
    // import java.util.*;
    import java.util.ResourceBundle;
    import java.sql.*;
    /* import org.apache.log4j */
    import org.apache.log4j.Logger;
    public abstract class GeneralDao {
    // operations
    * de GeneralDao is de algemene klasse waar alle andere DAO's of Data Access
    * Objects van erven. Het is de bedoeling om in deze klasse ��nmaal de
    * getConnection te defini�ren
    * <p>
    * getConnection() connecteert met de databank afhankelijk van de JDBC-driver
    * die voorhanden is. Deze methode zorgt ervoor dat alle afgeleide DAO's van
    * dezelfde driver gebruik maken terwijl er toch maar op ��n plaats de naam
    * van de driver gedefinieerd is.
    * </p>
         protected Connection getConnection()
              throws java.sql.SQLException
         Connection dbconn = null;     
         ResourceBundle resBundle;
         Logger mopoLogger = Logger.getLogger("mopo.log");               
         mopoLogger.debug("start connectie databank " );      
              try
              Class.forName("com.mysql.jdbc.Driver").newInstance();
              resBundle = ResourceBundle.getBundle("gcoConfig");
              mopoLogger.debug("ophalen resourceBundle (gcoConfig) " );
              String dbConnectie = resBundle.getString("databaseconnection");
              mopoLogger.debug("lezen databaseconnection in resourceBundle " );
              //dbconn = DriverManager.getConnection("jdbc:mysql://localhost/gco");
              dbconn = DriverManager.getConnection(dbConnectie);
              mopoLogger.debug("maken connectie databank " );
              } catch (InstantiationException e)
                   System.out.println("GeneralDao - Fout bij getConnection - instantiation " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - instantiation " );
                   e.printStackTrace();
              } catch (IllegalAccessException e)
                   System.out.println("GeneralDao - Fout bij getConnection - illegal acces " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - illegal acces " );
                   e.printStackTrace();
              } catch (ClassNotFoundException e)
                   System.out.println("GeneralDao - Fout bij getConnection - class not found " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - class not found " );
                   e.printStackTrace();
              return dbconn;
    } // end GeneralDao
    Each object of the Model type should have a corresponding DAO. In my webapp I had 3 kinds of model objects, so I've defined 3 DAO's. All these DAO's are children of the GeneralDao. I'll give an example of this.
    package org.gertcuppens.dao;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import org.gertcuppens.general.Gebruiker;
    /* import org.apache.log4j */
    import org.apache.log4j.Logger;
    public class GebruikerDao extends GeneralDao {
    * Zoekt de gebruiker op aan de hand van de opgegeven naam en wachtwoord
    * @return Gebruiker
    * @param _naam
    * @param _wachtwoord
    public Gebruiker findGebruiker(String naam, String wachtwoord)
    throws SQLException
         Logger mopoLogger = Logger.getLogger("mopo.log");               
         mopoLogger.debug("start findGebruiker" );      
    StringBuffer zoekString = new StringBuffer();
    zoekString.append ("select * from gebruiker ");
    zoekString.append("where naam=? and wachtwoord=? ");
         Connection con = getConnection();
    PreparedStatement ps = con.prepareStatement(zoekString.toString());
    ps.setString(1,_naam);
    ps.setString(2,_wachtwoord);
    ResultSet rs = ps.executeQuery();
    if (rs.next() )
    Gebruiker gebruiker = new Gebruiker(rs);
    rs.close();
    ps.close();
    con.close();
    mopoLogger.debug("gebruiker gevonden " + gebruiker.getNaam());
    return gebruiker;      
    else {
                   ps.close();
                   con.close();
                   mopoLogger.debug("geen gebruiker gevonden");
                   return null;
    } // end findGebruiker
    } // end GebruikerDao
    Want to know more about this ? Just give me a sign.

  • Unable to Distribute Model View in BD64

    Hi Gurus,
    Model View - SR2CLNT251
    Receiver of Model View - EA1CLNT251
    i went to txcode bd64 > i clicked on model view SR2CLNT251 then went to edit > model view > distribute and clicking the logical system of EA1CLNT251. then error will be encountered.
    Model view SR2CLNT251 has not been updated
    Reason: No authorization to change model view SR2CLNT251
    .....authorization object B_ALE_MODL
    .....Parameter: activity 02, model view SR2CLNT251
    i already given correct authorization to my ID, but still the error persists.
    Please help. Thanks!
    Regards,
    Tony

    Hi Tony,
    You need  authorization for authorization object  'B_ALE_MODL'  in system I guess either in system SR2CLNT251  or in EA1CLNT251.
    Best Regards,
    Tushar

  • Mapping Variables(Object View) to Measures(Model View)

    Hi,
    In my AW, I have created a cube, And then I have created a new variable in the object view and populated it using load programs. Now. when I try to create a measure in the model view of the same cube based on this variable, I cannot see any option for assigning a variable to a measure. Can someone please help me out in doing this?
    I need the measure in the model view, because it looks like, when I create a relational view, only the measures that are defined in the model are added to the view and not the variables available in the object model.
    Thanks,
    Bharat

    Hi Bharat,
    The mapping editor is used to map a measure to a relational data source. Therefore, unless you convert your data source used by your DML program to a relational table/view (if it is a text file you can use an external table to present the data to AWM as a relational table, or if it is an Excel spreadsheet and your database is on Windows you can use the heterogenous gateway service to load directly from Excel by exposing the Excel worksheet as a relational table) you will not be able to use the mapping editor.
    To assign an OLAP variable to an measure within a cube you will need to create a custom calculated measure. This will allow you to create a measure that "maps" to your OLAP DML program. There is an Excel utility on the OLAP OTN home page that allows you to create custom calculated measures (at the moment this feature is not AWM10gR2 - but is available within AWM 11g). Click here for more information:
    http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip
    My advice would be to try and convert your data source to a relational table/view and using the mapping editor. This will allow you to benefit from the many new features within OLAP cube storage such as compressed composites, data compression, paralled processing, partitioning and aggregation maps. Of course you can code all this manually but it is much easier to let AWM do all this for you via a few mouse clicks. Please note - that everything you build outside of the AWM model view has to be managed (defined, updated, backed up etc) by you rather AWM. So while there are lots of advantages of using OLAP DML, I personally always try to load data into my OLAP cubes using AWM mappings and save OLAP DML for providing the advanced types of analysis that make OLAP such an excellent calculation engine.
    Hope this helps
    Keith Laker
    Oracle Data Warehouse Product Management
    OLAP Blog: http://oracleOLAP.blogspot.com/
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    DM Blog: http://oracledmt.blogspot.com/
    OWB Blog : http://blogs.oracle.com/warehousebuilder/
    OWB Wiki : http://wiki.oracle.com/page/Oracle+Warehouse+Builder
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • Error in distribution of  model view

    I created a modelview for distribution of CLFMAS types IDOCS from DEV to PRD.
    Created ports,RFC destination etc.
    I was able to generate partner profile in the sending system.When I try to distribute the model view in BD64,
    I get this error . Initially, I thought it was because I did not have authorization for BD64 in PRD. Now that I have, I still get this error.. Any advice ?
    Distribution of model view CHARS2PRD                                                                               
    Target system PRD100                      Communication error occurred                                                                               
    Process request without transaction. TID is empty.

    I see the message did not post properly..THis is the message..
    Distribution of model view CHARS2PRD                                                                               
    Target system PRD100                      Communication error occurred                                                                               
    Process request without transaction. TID is empty.

  • Is model view(BD64) necessary for EDI

    is model view created using BD64 necessary for a EDI transactions? I have created a logical system, a RFC destination and a EDI File Port.
    After all this i am trying to push a material master data using BD10 to the file port. When i do that the system gives me a message saying that master idoc created but it does not create a communication idoc. Only if i have a Model view set up in BD64 it creates a communication idoc. So my question is do we need a model view for EDI configuration?
    ~Suresh

    Hi,
    BD64 is required for master data distribution..
    If you are having a interface that sends IDOCs to the customer or receive IDOCs from the vendor..You don't require BD64 setup..
    Thanks,
    Naren

  • Tcode  PFAL there is no model view for the distribution of HR Data.

    Hi friends ,
    i am facing new problem,i want to send iDOC to other system.
    previeous its working fine.
    but to day  when i open tcode PFAL.
    it give me Error:"There is no model view for the distribution of HR master data"
    what is the solution for that.
    i want to send HR Data.
    its urgent please give me any solution ithat will help me alot.
    thanks in advance

    There is already Distributed Model Created.
    can u give me annother tcode so i can  send Metarial data, by IDOC.
    please help me.
    Thanks

  • Reg. Model View BD64

    Hi,
    I have created a model view  and generated the partner profiles. when i am distibuting the model view, I am getting an error " Model View XXXX has not been updated"  "Reason: Maintenance systems for model view XXXX are not identical".
    could anybody tell me , how to resolve this issue.
    Thanks & Regards,

    Any luck with the resolution to this error?
    Thanks,
    John

  • Problem in Disrtibuting Model View

    Dear Geeks,
    I have a problem in distributing the model view.
    I have created a new Model view & added message type DESADV to it along with the SENDER & RECEIVER system.
    Sender System: ECC 6.0
    Receiver  System: PI 7.0
    Error Message:
    ModelView PI-TRAN has not been updated.
    Reason Distribution model is currently being processed.
    How to resolve it or what could be pssible cause?

    Hi Yogesh,
    Yes other systems are using the Sender logical
    system but not the Receiver logical system defined/used by me.
    Yes some other models are active with Sender
    logical system that i have used as their Receiver
    logical system but with some other Message types.
    Will the above settings conflict with that of my Distribution model?
    Thanks,
    Rajendra.

  • Problem with Model View

    hi friends,
    i am working with ALE to transfer data across two clients.
    i had created two logical system EDI900, EDI950 and model view MODEL_VIEW
    but when i am distribute this model view i am getting error as
    model view MODEL_VIEW has  not been updated
    reason:maintance system in sending system EDI900
                 maintance system in receiving system EDI950
    i had searched in SDN with this keyword i got lot of links but i can't find proper solution.
    so please give me the correct solution.
    thanks in advance.
    Regards,
    Karunakar

    hi jurgen,
    thanks for your reply.
    here i am distributing model view with message type.
    and i am transferring data across two clients in one SAP system.
    here i am ligin in target system and delete the model view which previouslly assigned.
    now i am distributed successfully.
    Regards,
    karunakar

  • IDOC Model View Generation Issue

    Hi all,
    I am working on IDOCS and I am facing the follwing error when I try to distribute the Model View in IDOC--
    "the following ALE connection already exists in model view HR_TO_PI"
    I had deleted the above "HR_TO_PI" model view and I created a new one with new name.
    But I still get the same message.
    I don't think this is an issue with configuration.
    I am assuming it's an issue with table entries. Does this-"HR_TO_PI" value get stored in any table in the back end ?
    Kindly help. I had a look at SDN and other places but they all ask to check for partner profiles and logical systems which I believe I have configured right.
    Warm regards,
    Hari Kiran
    Edited by: HARI KIRAN REDDY on Feb 23, 2012 11:24 AM

    Hi Sravan,
    I had a look at TBD00. It shows all my current distribution models but not the one mentioned in the error.
    I had a look at some other tables in the TBD series but of no help.
    I don't know in which table  that entry has ended up.
    It's frustrating.
    Thanks for the input once again.
    Warmr egards,
    Hari Kiran

  • IDoc to IDoc scenario: distribute the model view

    Hi!
    I try currently to  configure a IDoc to IDoc scenario for SAP ECC 6.0 system with following business 2 systems:
    ERP:100 (Sender)
    ERP:200 (Receiver)
    and XIB:100 (XI system)
    I successfuly created  a message type and generated the model view in tcode BD64.
    Question:
    When I try to distribute the model view which system should I choose?
    a) XI System or
    b) Receiver system ERP:200
    When  I choose the receiver system ERP:200 and get the following error
    Target system: ERP:200
    Model view ECCCLNT100 has not been updated
    Reason: Distribution model is currently being processed
    When I try to choose my XI system I get the following error:
    Target system: XIB:100
    RFC destination for synchronous communication (message type SYNCH)
    Partner profile LS PIBCLNT100 SYNCH does not exist
    Generate partner profile
    or specify outbound partner profiles for message type SYNCH
    Is that an error? If yes, how can I fix them?
    Thank you very much
    Thom

    Hi
    Look my reply on this thread regarding SYNC Message Type.
    Re: problem while distribute model view
    When I try to distribute the model view which system should I choose?
    a) XI System or
    b) Receiver system ERP:200
    You are sending IDoc to XI then R/3 so select XI system. because receiver of IDoc is XI then IDoc would be send from XI.

  • IDOC to IDCO scenario: Distribution of model view

    Hi!
    I try currently to configure a IDoc to IDoc scenario for SAP ECC 6.0 system with following business 2 systems:
    ERP:100 (Sender)
    ERP:200 (Receiver)
    and PIB:100 (XI system)
    I successfully created a message type u201CZCREMRu201D and generated the model view PIMODEL in tcode BD64.
    Sender: ERP:100
    Receiver: PIB:100
    I assigned 3 partner profiles ERPCLNT100, ERPCLNT200, PIBCLNT100 and assigned a message type SYNCH with IDOC type SYNCHRON as outbound parameter.
    Unfortunately when I try to distribute the model u201CZCREMRu201D and choose my XI system I get the following error:
    Distribution of model view PIMODEL
    Target system PIBCLNT100      
    Model view PIMODEL has not been updated
    Reason: Distribution model is currently being processed
    Question:
    Do I miss some other inbound and outbound parameters?
    IF yes, which and on which systems?
    Thank you very much!
    regards
    Thom

    Hi Rob
    Y're right i made mistake when i was creating in SRM RFC destination puting host name of SRM system  not ERP.
    Thanx
    Marcin

  • How to do outer join in data model view?

    Hi,
    I have 2 queries are needed to be joined in Oracle Report 6i Data Model View. What I want to do is below:
    where table1.receipt_no(+)=table2.receipt_no
    How do I use the 'Data Link' to do this in Data Model view?
    Thanks.
    Jun

    Hi
    You need to use data links. Refer data link section in BUilding Reports manual at http://otn.oracle.com/products/reports/htdocs/getstart/docs/B10310_01/orbr_concepts1.htm#1013156.
    Thanks
    Rohit

Maybe you are looking for