Cannot decide which pattern reflects on my application

I have a video-club management application implemented in Java, in which i followed the relatively general MVC architectural pattern.
1. my model consists of java classes mapped to database tables via Hibernate
2. my view consists of various frames in which the only logic directly implemented has to do with button listeners; database operations are called from the Controller.
3. my controller consists of a class in which various database operations for my objects as well as other functions are defined ( save(Customer cust), delete(Customer cust), List <Customer> getCustomers() and so on ).
I was told that it is not necessary to follow only one design pattern and that since MVC deals with the overall structure of the application in a more wide/general way, i can find other design patterns that deal with more specific parts of the application.
I have been looking for quite some time.
My confusion starts with the use of Hibernate; i found some patterns that deal with similar situations such as Active Record or DAO but i cannot tell for sure that my design follows the same rules.
I cannot understand why active record pattern is related and compared with hibernate (http://www.javalobby.org/articles/activeobjects/). Supposedly you can use more than one design patterns, how is it possible to have MVC and active record, when in AR you have to define database operations in the model (http://www.martinfowler.com/eaaCatalog/activeRecord.html) while with MVC and hibernate the model has nothing to do with the database directly.
I know that design patterns are meant to be used as solutions to problems and should be selected and followed before you actually start implementing the application, but any suggestion regarding which design pattern might fit in order to search for more information would be really appreciated.
Since i am not a developer and this application is my BSc's Final year project, in order to avoid any misunderstanding, the suggestions i am looking for, are meant to be a simple guide in terms of "check for this" or "no you got it wrong" rather than the actual solution.
thanks in advance

stathisoeo wrote:
I have a video-club management application implemented in Java, in which i followed the relatively general MVC architectural pattern.
1. my model consists of java classes mapped to database tables via HibernateSo, is the tail wagging the dog or the other way around? By that, I mean you will either end up creating your tables to resemble your objects or vice versa. Relational and object oriented are different concepts. Many times, you can map one-to-one, but there are enough differences to make it a headache.
2. my view consists of various frames in which the only logic directly implemented has to do with button listeners; database operations are called from the Controller.Seems ok. Swing, I presume?
3. my controller consists of a class in which various database operations for my objects as well as other functions are defined ( save(Customer cust), delete(Customer cust), List <Customer> getCustomers() and so on ).
These operations are typically done in a data access object. Your controller will typically only need a single piece of information, such as the primary key of the record, to pass to the DAO. (Of course for something like an update or create operation, you need to also supply these values or pass in a fully assembled Customer object, like you are doing above, but for a simple select or delete, you don't need the whole object per se).
>
I was told that it is not necessary to follow only one design pattern and that since MVC deals with the overall structure of the application in a more wide/general way, i can find other design patterns that deal with more specific parts of the application.The terms are a bit fuzzy here, generally. I personally view MVC as an architecture rather than a design pattern. It suffuses the entire application. You will use many other actual design patterns alongside MVC. Typically, a pattern is employed for a specific task.
I have been looking for quite some time.
My confusion starts with the use of Hibernate; i found some patterns that deal with similar situations such as Active Record or DAO but i cannot tell for sure that my design follows the same rules.
Don't simply use a pattern for its own sake. A DAO is straightforward enough that I would be surprised not to find it in a non-trivial application. Simply place all persistence logic for a given domain object in a separate object. Hibernate (or any ORM tool generally) allows your regular domain object to become an active record.
I cannot understand why active record pattern is related and compared with hibernate (http://www.javalobby.org/articles/activeobjects/). Supposedly you can use more than one design patterns, how is it possible to have MVC and active record, when in AR you have to define database operations in the model (http://www.martinfowler.com/eaaCatalog/activeRecord.html) while with MVC and hibernate the model has nothing to do with the database directly.
MVC is your architecture. Hibernate allows a POJO (plain ole java object) to be an active record. Typically, you still want a DAO. But if all your object does is crud (create read update delete), then you can either have one generic DAO to handle such objects, write a DAO for each, or dispense with the DAO entirely. You can still have any number of other patterns being used (visitor, strategy and memento are very common in code).
I know that design patterns are meant to be used as solutions to problems and should be selected and followed before you actually start implementing the application, but any suggestion regarding which design pattern might fit in order to search for more information would be really appreciated.
See above. Don't start by saying, "I want to use this pattern, where will it fit?" Rather, start by sketching out your solution at a high level, without consulting any patterns. Then look at what you have and see if any patterns show themselves. Pattern-fever is a disease that afflicts many when they first start using design patterns.
Since i am not a developer and this application is my BSc's Final year project, in order to avoid any misunderstanding, the suggestions i am looking for, are meant to be a simple guide in terms of "check for this" or "no you got it wrong" rather than the actual solution.
See above.
thanks in advanceYou are welcome.
- Saish

Similar Messages

  • Cannot decide which macbook pro retina to buy

    Hi all,
    I am new to the community even though i have been usinig a macbook since 2009. My old macbook pro got stolen and i need to buy a new one now! I am between the following setups:
    1) refurbished retina 15" early 2013, 2.7Ghz, 512 SSD, Nvidia gt 650, 16 GB ram
    or
    2) new 15" Haswell retina 2,0 Ghz 256 SSD, Iris Pro, 16 GB ram
    Which one would you choose if you take into account that the haswell model is actuall 100$ cheaper than the refurbished one?
    I want o keep it for at least 5 years. Will the Nvidia 650 gt make a big difference? I do not use any demanding photo editing or auto cad software but i would like to be able to play games (First person shooter) from time to time, even though i have a desktop for that.

    Hi! 
    For gaming MB is better with Nvidia GT 650 GPU. Here are these 2 GPU's comparision link
    I have early 2013 Macbook Pro Retina and I am totally happy about GPU and CPU performance.
    But in your way i'll choose newest model, because you have desktop computer for gaming (IMHO gaming is always better on desktop).
    New Haswell cpu is good for battery life!
    In this computer age new is always better

  • E71 cannot choose which sip profile to use VoIP

    I created several sip voip profiles, one for domestic call, another for international call. The problem is, when I dial a number and click on internet call, E71 will persistently use a certain profile merely. I cannot decide which sip profile to use.
    Could you please give me some advice? Thx!

    Thanks Carlo for your reply.
    I have read again the link and you are correct that in using the preferred command together with localhost under POTS dial-peer, I can now select which correct path to choose for my outbound calls. I'm just not very strong with dial-peer and translation rules at the moment.
    I will try this solution during the weekend and let you know. But it would have been better if there was a sample configuration for this option.

  • Does any body have any design patterns of JSF Web Application Developping?

    Can any one answer me some questions?
    #1.I am an amatuar of people who develop Web Application.For some reason,We choose the JSF to develop our item.through some introduction,I know the UI component of JSF is resided in Server side,is it right?but I am a little confused that:if there are many users who are exploring our jsf website.(to simplify my question,image I had just one web page and just one button)How many UI components(buttons) will be there?How it(they?) works?
    #2.Does any body have the success experience (for example design pattern)to develop web applications?if We just concern about the Add,Delete,Modify,Query operations of some data.
    I just do my job according to my feeling.
    I will give every page a pagebean(backing bean),and I am not sure how to combine the business data with the pagebean.some one suggested that I should use delegate pattern to separate my business log and page logic.But I am still confused by following things:
    #2.1 does JSF have the same ability to help us construct the model dialog just like swing to
    help us control the operation flow?
    #2.2 If there is not,Does the following way work?I put every tabledata's property as corresponed component.if user choosed the row in the table,My Listener will syncronize the row data to the components.But
    #2.2.1 if JSF has the components according to the web users' number,how can My Listener tell which component should be update?Should I maintain the map?
    #2.2.2 If the problem I imaged above is false,Does any body can tell me how to custom      the ListDataModel,so I can use it like Swing?because now I can just use some view data to insert into ListDataModel,but after some selection operation,my business object must be find according to the selected data,it is not an interesting job!
         I am waiting for your advice!

    Ok I'll try to explain Step by step please correct me if I make any mistake because I have not played much with shared variables.
    To create a shared variable to an RT target go to the target if tou have already otherwise add an RT target by right clicking the Project>>Add targets and Devices
    Then in the target Right clikc and select the variable as shown below.
    Then once the Shared variable settings window opens Enter a variable name and then Select the type "Network Published"
    In the right side you can select the data type for the shared variable and even you can choose your custome controls.
    After selecting the data type go for the Network and select buffering if required else leave it if you are planning to use the variable just for display purpose.
    Then you can enable the RT FIFO if required (Not able to explain how it works and why it is used).
    Then after completing the Shared variable setup you can access the variable in the VI in both the Host and the RT.
    You can bind the variable to a control so that if any data from the RT is coming you can read the data from that control.
    Once you have placed your shared variable in the BD you can change the access typr to read or write depending on your need.
    This might not explain the complete shared variable concept but I believe that this would defenelty give you a kick off to start using the shared variable. Please correct or add more comments if anybody know better.
    Good luck.
    The best solution is the one you find it by yourself

  • 2TB Serial ATA drive alone or with 256 GB Solid Drive - Cannot decide?

    I am just about to take the plunge and buy a new Mac.  I do alot of video work with Final Cut Express and I have probably 15,000 photo's on old mac.
    I cannot decide whether or not to add the Solid Drive, is it worth it?  Or will the 2TB be sufficient.
    Any advise is appreciated.

    What lazyboyaimm meant is that, "theoretically", you could remove the CD/DVD drive from your brand new computer and install an SSD drive in that slot.  HOWEVER, it is a difficult procedure AND you would immediately VOID YOUR WARRANTY on your brand new computer.  Why would you want to do that when you can simply order the machine the exact way you want and Keep your Warranty???  I do not recommend that.
    In my honest opinion, the 2 TB harddrive would be most sufficient for what you are planning to do.  The only reason for also getting the SSD drive is that you could install your OS and Applications on the SSD to make them open faster, and keep your data and files such as the photos on the much larger 2 TB drive.  You would not really need the 256 GB of additional space from the SSD, if you already had the 2TB drive; the SSD would simply allow your OS to run faster.  So the real question to you is: is running your OS and apps faster worth $500 US?  Only you can answer that.  Best wishes.
    Hope that helps

  • Can I decide which graphics chip I can use in MacBook Pro with Retina?

    I have a MacBook Pro with Retina display. I have the 15inch model so I have the Intel HD 4000 as well as the NVIDIA GeForce GT 650M. My computers automatically decides which graphics chip to use which I now I normal BUT I was wondering how and if I would be able to choose which graphics chip I would like to use.

    Most of the time, your computer will switch between graphic chips automatically - so you're right, you don't have to choose. However, in certain situations, your machine will get too hot or you'll get too much drain on your battery. In that case, you may have to choose the chip: in that case, gfxCardStatus http://gfx.io is a good application to download. It's free.

  • How does disk utility decide which optical drive to use for burn?

    This is a somewhat daft question and purely out of interest.
    How does disk utility decide which optical drive bay to open for burning?
    I have two drives in a MacPro and both have the same capabilities (DVD-RW). Why does it sometimes open the lower one, and sometimes the top one?

    Grant Bennet-Alder wrote:
    The estimate is based on how long it already took to do how many blocks, and how many blocks are left to do. If you told it to overwrite 35 times, it will be a long, long time before it completes.
    The estimate is made grossly large by the presence of Bad Blocks that need to be Read during the test (not the case with Erase and Write Zeroes).
    Each Block is written with some redundancy bits, so that small errors can be corrected on reading. A Bad Block causes the drive to re-read. and re-read, and re-read, in hopes of getting correctable data the next time. This should NOT be an issue in writing. But if the drive stops responding (which can and does happen with a bad drive) the Erase function will just sit there, thinking it is making progress, and stretching out the time.
    Thanks, Grant.
    If I read your reply correctly, Erase and Zero Out free space shouldn't elongate the process, because there's no read occurring.
    The drive will not be Mounted while Disk Utility works on it, so it will not be on the Desktop. But ask Apple System Profiler \[ About this Mac > More Info > Serial ATA ] if the drive is still THERE . If it cannot be seen, you have your answer -- the drive dropped out of sight while being tested -- Bad Drive.
    Well, now I am confused. It's a FW800 drive. It's on the Desktop. And it appears under FireWire in System Profiler. AND Disk Utility shows a mount point. But the Unmount and Eject buttons are grayed out.
    Will the drive be mounted if it fails to respond to Disk Utility? That doesn't seem to make sense.
    How do I determine its status? It appears to be stuck at "1 day, 5 hours" but it'll take an hour for that to change. I think it's been that long since I first noticed the time.
    Harv

  • I am trying to decide which OS to upgrade to because I am not sure what my computer will handle

    I am trying to decide which OS to upgrade to because I am not sure what my computer will handle and I don't want to pay to upgrade to a version that I do not have the hardware to support (i.e. memory or CPU speed). I tried to install Turbo Tax and I was told I needed 10.7 or higher. Could you please help. I have an iMac and my OS is 10.6.8 plus the details below.
    Model Name:    iMac
      Model Identifier:    iMac11,2
      Processor Name:    Intel Core i3
      Processor Speed:    3.06 GHz
      Number Of Processors:    1
      Total Number Of Cores:    2
      L2 Cache (per core):    256 KB
      L3 Cache:    4 MB
      Memory:    4 GB
    Thanks
    <Re-Titled By Host>

    System requirements for OS X Lion
    OS X Mountain Lion system requirements
    OS X Mavericks system requirements
    Apple - OS X Yosemite system requirements

  • How to load data from a  flat file which is there in the application server

    HI All,
              how to load data from a  flat file which is there in the application server..

    Hi,
    Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
    If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
    Please let me know if this is helpful or if you need any more inputs.
    Thanks & Regards,
    Nishant Tatkar.

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • I have a pop up which I can't get rid of which states: "There is no application set to open the URL ximadpzl://save_ximad_token----/"

    I can't get rid of a message which keeps popping up which says:
    There is no application set to open the URL ximadpzl://save_ximad_token/(etc)
    I have no idea to what they are referring and I can find no application which satisfy this requirement. How do I get rid of this message? It won't go away. I have tried turning off the computer, closing Safari, etc.

    All of these suggestions (delete caches, restart, terminal commands, etc) do nothing to actually LOCATE the problem. They are just standard purging processes, and they have all failed to achieve resolution.  And it is NOT Little Snitch either (tried turning that off and nothing changed).  All these forums on this matter have been speculative and useless.
    Ladies and Gents... I have found and isolated the ACTUAL PROBLEM.  It is a Safari Extension that is doing it... specifically "VideoCatcher 5.3.8" which for me was installed with MovieSherlock.  The extension adds the ability to download YouTube movies directly from Safari (by showing a small download button next to any embedded movie). When I remove that extension, all the annoying pop-ups go away.
    MovieSherlock is not the only utility that does this however. There are several YouTube downloaders out there that ALL install an extension that detects YouTube videos on the page. I bet my hat that many (if not all) of you who are experiencing this pop-up issue... have installed one of those downloader utilities.
    So, the solution is simple: disable that extension. If you need to download a YouTube video from a page, either temporarily enable that extension again as needed, or leave the Safari integration disabled and launch the actual utility itself and enter the URL into it for your download.
    I would expect that MovieSherlock and the other YouTube downloading utilities will need to update their extensions (soon?) to deal with Yosemite's new browser script management.
    PROBLEM SOLVED.

  • I cannot get my MacBook Pro to print greyscale on my Canon MG6450. I cannot access the printer driver panel on the Macbook. So I am stuck printing everything in colour and cannot specify which pages I want printed.

    I cannot get my MacBook Pro to print greyscale on my Canon MG6450. I cannot access the printer driver panel on the Macbook. So I am stuck printing everything in colour and cannot specify which pages I want printed.

    Try resetting the printing system:
    OS X Mavericks: Reset the printing system
    Next try deleting the system and reinstall the printer..
    BTW this is Mac Pro desktop forum

  • Windows 7 decide which route to take if THE PC Has 4 connection (4 X 1 Gig) available to internet

    Hi Network experts
    realy i need you to figure out the below
    1)how windows 7 decide which route to take if  THE PC Has 4 connection (add on 4 X 1 Gig)  available to internet , the route print on windows machine shows the 4 
    connection with same metric (metric 10) , the adapter order is as follows 
    G1,G2,G3.G4
    2)what about the less subnet id if each interface has less subnet id than other
    3)the built in interface (gig 0) why have metric of 286 not 10 like others
    thank you all 

    Hello.
    As far as I remember, Windows uses ANY of the routes with equal metric.
    I'm not sure if there is publicly available algorithm, but I believe it may switch from one interface to another if experience packet loss on the current.
    So, the conclusion is: the outgoing interface is not predictable.
    If you want any kind of reliability you would better to create port-channel and use FHRP on your routers.

  • Invoice amount which is reflecting in our customer ledger

    Hi gurus
    In few cases Invoice amount which is reflecting in our customer ledger is basic value insted of " net selling value" ( basic price + Tax Price ). Due to which in my customer ledger receivables are showing less as per Invoice value.
    Can you solve this problem. and tell me the solution.
    Thank you
    Anil

    Hi
    May be the report you are looking is CO-PA report ....if it is the case goto the report form and goto the column of net selling value...and change the formula used over there....if it is a customised (Z report) ...take the ABAPer help....if it is standard report, please let me know the TCODE..so that it will be easy to check the logic
    VVR

  • In few cases Invoice amount which is reflecting in our customer ledger

    Hi
    gurus
    in few cases Invoice amount which is reflecting in our customer ledger is basic value insted of " net selling value" ( basic price + Tax Price ). Due to which in my customer ledger receivables are showing less as per Invoice value.
    what i would like take futher steps to solve this problem.
    Thank you for immmedeatly.
    Anil

    Anil,
    You have to look to the pricing in your SD invoice for these situation. I thing there is somthing wrong there.
    Paul

Maybe you are looking for