Suggest what design pattern is applicable for my case

I have an object called GrantAward , these awards I have to show to the user for selection
1. I call a web service to get list of GrantAwards.
2.for each GrantAward check if this is present in my database
a. if not there insert
3.for each GrantAward check some conditions
a if satisfied add to the list to show to user
b if not satisfied do not add to list .
these are the steps involved before I can show the GrantAwards to user for selection , please suggest me what design pattern can I use ?

I'm not sure you want to hunt for patterns when you already know what you are implementing. A lot of people have pattern fever. Patterns are useful constructs for communicating design ideas and enforcing best practices. But I rarely go out and hunt for a specific pattern (or name my objects after patterns). If you are doing a heavyweight methodology with RUP or something similar, I could see stereotyping your UML with patterns.
That having been said, you already have a Facade with your service. You are undoubtedly using DataAccessObject to fetch your records. Your conditions could be implemented with a ChainOfResponsibility and/or Strategy pattern. What you return could be a Composite. Potentially the request and response are a Command. And your overall architecture could be MVC.
But IMO that is overkill.
- Saish

Similar Messages

  • Regarding which design pattern to use for this scenario???

    hi guys
    I am working on a J2EE application where I need to do translations for 3 different scenarios. It is basically a conversion from service order objects to invoices.
    First from a service order object to an invoice.
    Second a conversion from a transaction table.
    Third a conversion from a remote system.
    Finally the product is an invoice..
    What design pattern can i use ....is strategy pattern a good idea??
    Thanks
    J

    Hi,
    I think your problem is in result state. You can you sequencial block but for approve or reject you need to set target for each result state. Here I am providing a link. I think you will get your solution here please go through it.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/44/429bbd709914bce10000000a155369/frameset.htm
    if you have any query please let me know.
    Thanks
    Chandan

  • Can you suggest a Design pattern for moving a desktop app to  web?

    Hi,
    I have been asked to move a desktop applciaiton which has Serialized files as persistant layer in to Web, can anyone suggest me a good design pattern to accomplish this.

    I dont know what data is in the files, but I suggest looking at creating a set of database tables, normalize them, and copying the data to the tables (via java). Have a DBA review your database schema design if possible before copying the data. Then, use MVC design as I describe here:
    http://forums.sun.com/thread.jspa?messageID=10786901
    Once you get experience in the MVC design described above, your next project can use MVC with a framework such as Java Spring (a more advanced topic). You should read a book cover on Spring to cover on it first.

  • Design Patterns, best approach for this app

    Hi all,
    i am starting with design patterns, and i would like to hear your opinion on what would be the best approach for this app. 
    this is basically an app for data monitoring, analysis and logging (voltage, temperature & vibration)
    i am using 3 devices for N channels (NI 9211A, NI 9215A, NI PXI 4472) all running at different rates. asynchronous.
    and signals are being processed and monitored for logging at a rate specified by the user and in realtime also. 
    individual devices can be initialized or stopped at any time
    basically i'm using 5 loops.
    *1.- GUI: Stop App, Reload Plot Names  (Event handling)
    *2.- Chart & Log:  Monitors Data and Start/Stop log data at a specified time in the GUI (State Machine)
    *3.- Temperature DAQ monitoring @ 3 S/s  (State Machine)   NI 9211A
    *4.- Voltage DAQ monitoring and scaling @ 1K kS/s (State Machine) NI 9215A
    *5.- Vibration DAQ monitoring and Analysis @ 25.6 kS/s (State Machine) NI PXI 4472
    i have attached the files for review, thanks in advance for taking the time.
    Attachments:
    V-T-G Monitor_Logger.llb ‏355 KB

    mundo wrote:
    thanks Will for your response,
    so, basically i could apply a producer/consummer architecture for just the Vibration analysis loop? or all data being collected by the Monitor/Logger loop?
    is it ok having individual loops for every DAQ device as is shown?
    thanks.
    You could use the producer/consumer architecture to split the areas where you are doing both the data collection and teh analysis in the same state machine. If one of these processes is not time critical or the data rate is slow enough you could leave it in a single state machine. I admit that I didn't look through your code but based purely on the descriptions above I would imagine that you could change the three collection state machines to use a producer/consumer architecture. I would leave your UI processing in its own loop as well as the logging process. If this logging is time critical you may want to split that as well.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Design Pattern help needed for MDI application

    Hi,
    I am writing an mdi application which contains a JSplitPane. The left pane contains a JTree and the right contains a JDesktopPane which houses n number of JInternalFrames. The JInternal Frames need access to the JTree. Also both panes (objects w/in) need access to elements of the JFrame. I am currently implemeting access by making most of the JFrame objects static and creating getter/setter methods for access. Does anyone know any desing patterns I might use to solve this dilemma?
    Thanks,
    John

    The observer design pattern causes the child objects to chage state when the parent changes state. The type of pattern I need would allow the child objects of the parent JFrame to be available globally without having to make them static. I am wrong in this? Would the observer pattern solve this issue.

  • What Design Pattern - Change Language functionality

    On my application, I will have a series of buttons to choose
    a language. When the user chooses a language, all control labels,
    pop-up messages and others will change at the chosen language.
    I would like to do this from an OOP point of view and use
    Design Patterns. Which one would you recommend to use?
    My guess is the Strategy Pattern. Am I right?
    Thanks for any comment or link.

    The Strategy Pattern is used to swap algorithms dynamically.
    Based on user input a decision can be made to run a (set of)
    function(s). This behaviour is encapsulated in seperate objects.
    You just want to swap data at runtime. Or maybe set some
    behaviour regarding specific functions in languages like the way
    currencies are handled, measurements and the like. The latter would
    be implemented as Interpreter Pattern.
    When it's merely data that needs to changed/loaded at
    runtime, than it's more like a change of the Model in the MVC
    design pattern, using an Observer to notify all registered
    'listeners' and using a Command to get the thing going.

  • Please suggest appropriate design pattern

    Hi,
    In my method currently I have around 13 if statements, each if statement checks for the instance of a particular object and takes action accordingly. The code looks ugly with too many If statements. Is there any suggested patten which I can use to eliminate these if statements?.
    Thanks in advance.

    ams_z wrote:
    Hi,
    In my method currently I have around 13 if statements, each if statement checks for the instance of a particular object and takes action accordingly. The code looks ugly with too many If statements. Is there any suggested patten which I can use to eliminate these if statements?.If these are your own classes
    have them implement an interface so the objects can perform the action themselves.
    If they are predefined classes
    write action methods that take each of them as argument
    or write wrapper classes for them with an action method.

  • What query should be created for this case

    Here are those classes:
    Folder{
        String name;
        @ManyToOne
        Subject owner;
    Subject {
        String name;
    }What query should I create in order to: find out if there is an actual Folder for a Subject with the name X in the database ?
    Actually, the question is kinda stupid, but im not experienced with queries....

    javaUserMuser wrote:
    Here are those classes:
    Folder{
    String name;
    @ManyToOne
    Subject owner;
    Subject {
    String name;
    }What query should I create in order to: find out if there is an actual Folder for a Subject with the name X in the database ?Can't tell based on the info you posted. These are Java objects, and queries deal with relational tables.
    Your naming is confusing. Subject and owner are two very different things.
    If I had two tables like this:
    CREATE TABLE IF NOT EXISTS owners
        owner_id bigint not null auto_increment,
        name varchar(80),
        primary key(owner_id)
    CREATE TABLE IF NOT EXISTS folders
        folder_id bigint not null auto_increment,
        name varchar(80),
        owner_id bigint   
        primary key(folder_id),
        foreign key(owner_id) references(owners)
    );I'd write the JOIN query this way:
    SELECT f.name, o.name
    FROM folders as f, owners as o
    WHERE o.owner_id = ?
    AND o.owner_id = f.owner_idYou realize, of course, that if you're using EJB3 as the annotations suggest, that you don't write any SQL. EJB3 generates it dynamically for you.
    %

  • Hi guys I'm wondering what's the best resolutions for the case ?

    I have my iPod and I put it on charge battery the night before.
    On the morning I'm checking it I fund it been turned off and it haven't turn on at all its unbelievable my mate see it u told me its power issue and say's to me could be cost repairing as you buying new one its iPod 4 generations what's the best resolving do u think guys thanks?

    Wow.
    Very hard to read.
    Please repost using sentence structure and punctuation.

  • Design pattern for several conditions

    Hi;
    I would like to implement an search algorithm which use many conditions (search criteria).
    For Example
    Begin :
    If criteria A && B are OK => if criteria C is OK => etc...
    Else criteria D && F are OK => if criteria C is OK => etc...
    Else etc...
    which design pattern or another design correspond to my requirement ?
    Regards;

    You are missing the point somewhere. Object-oriented design patterns are tools used to design object-oriented applications. There is a certain limit to size that is associated with warranted usage.
    In other words, the issue of your post is a trivial element of conditional processing. There is no such design pattern to apply to such a thing because that is not what design patterns are used for.
    Aside, some forum "genius" is going to post some application of a design pattern to this issue and then call me crazy. Looking forward to it :o)
    Your question would be better suited if it asked for what type of conditional processing algorithm might work well. In Java there are a few to work with. If statement, do while statement , while statement, case, etc.

  • Design Pattern for Servlets

    Hello,
    I am about to organize my huge servlet code. I have a web application which is currently running as a single servlet (I know bad bad design) and I want to filter out from there to a more manageable and appropriate design. I researched the internet and did not find a compelling design pattern or library that I can use to do the same. I would really appreciate if experienced folks could share what design patterns they use for the entry servlet to their web-app. Thanks in advance.
    Ravi.

    Check out the famous Struts.
    Regards,
    Reflex

  • WebService Design pattern

    Hello everyone,
    I'm working with a WEbService using Axis1 generated client code.
    Can anybody give me a good linkg to a Design pattern to use such generated code.
    Regards,
    Sebastien Degardin

    I don,'t fully agree with that.fine. why bother asking questions if you're just
    going to disagree with the answers that don'tmatch
    up with your own?Because, i aksed a question, nobody give me an
    answer.
    They, you, just contested the question, not trying to
    respond.
    That's why I don't FULLY agree.there is no answer to your question. a design pattern won't tell you how to use generated code. a design pattern might help in using specific generated code, but that's not what you asked. we can't second-guess what your code looks like, and what you need to achieve with it
    >>
    Patterns and Pattern Languages are ways todescribe
    best practices, good designs, and captureexperience
    in a way that it is possible for others to reusethis
    experience.you specifically asked about design
    patterns.
    more specifically, webservice design patternsI said, i USE WebService with Axis, and asked for
    Design pattern for such case. not asked for desicion
    about design pattern.see above reply. design patterns are not magic beans that can be applied to any problem. especially, not to vague problems like this one
    A design pattern for Axis generated code is
    possible.you're telling me there is a "use axis code" pattern? there isn't, any more than there is a general-purpose recipe for chefs. if you think there is, lots of luck tracking it down.
    Of course, i found a way to use a generic mechanism
    to centralize the request creation, request call and
    response validation.
    This avoid boilerplate code in each method call.
    But, that said, i don't have so much experience with
    that, that's why i asked for another example ...
    So, in my case, i think there should be best orgood
    practices which have been captured by experiencewith
    WebService and Axisv or other auto-generated
    code
    which would provide reusabilityn, scalabilityand
    For me Design pattern are applicable for a lot a
    things in a lot of domains.good for you. but remember that "for me" is not
    necessarily the same as "in reality"If you take EJB 2.1 and DTO, they are not always seen
    as good practices.
    But, however, they are books which related Design
    Pattern for such technologies, and they don't talk
    about the desicion of choosing EJB or NOT.what are you talking about? the DTO pattern solves - sort-of - a specific problem that often arises while using EJB, for example. it's not a "how to use EJB" pattern

  • Design pattern for swind application development

    Hello all,
    I am trying to develop a new swings application with the centralized database connectivity for the data transaction .Any one please tell me which design pattern is mostly suitable for the GUI application development using swings .
    Thanks in advance
    sowjanya

    Pu - this is your decision.
    In order to know which design patterns are suitable for you, you should know what the design pattern do.
    So I suggest to read about design patterns:
    http://en.wikipedia.org/wiki/Design_pattern_(computer_science)
    Note also that ther exists a framework called Spring.
    Greetings
    Thorsten

  • Design patterns for keypad...

    Hi All,
    what design patterns should I use If I need to program a front panel(
    keypad+display) for a phone which is going to have a lot of many different commads?
    are there any good examples ?
    thanks.

    . What design patterns can be used for data access to
    ensure that only a minimum amount of data is
    maintained in sessionThat's not a design pattern, that's business logic.
    Your application has to determine what "minimum" means.
    Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out.

  • Design patterns  for data access

    . What design patterns can be used for data access to ensure that only a minimum amount of data is maintained in session

    . What design patterns can be used for data access to
    ensure that only a minimum amount of data is
    maintained in sessionThat's not a design pattern, that's business logic.
    Your application has to determine what "minimum" means.
    Martin Fowler has lots of patterns for data access in his "Patterns of Enterprise Application Architecture". Check them out.

Maybe you are looking for

  • Saving Mail (Add a Folder?)

    I would like to be able to save important emails on my iPhone without having to worry about accidentally deleting them when cleaning out my InBox. Am using POP mail. Posted this earlier and received response the option did not exist. Was wondering if

  • My Apple TV is reading " There was a problem connecting to the network" error - 3906

    I have reset all network components and the Apple TV.  I first set up Apple TV and it worked beautifully.  The next time I turned it on it gave me the error message.  I have tried reconnecting to the netwrk multiple times.  I have my laptop and my ip

  • VPN Server

    I can not seem to STOP the VPN server.  I select the toggle and it switches to off but if I click off the VPN selection and go back its back on again.  The green "dot" next to VPN never goes off.  Any ideas?  No users connected. 

  • Some of my text turns up as images, why is this?

    When I publish my site I cannot select a lot of the text in different places on my site, it's all png files. Whats going on?

  • FIOS, and why I wish that I had never signed up.

    I had been using Verizon dsl, as well as local phone service.  I had a problem with the dsl and they sent me a new modem, noting that I should return the old one, else I would be charged an unknown fee.  The new modem worked.  I did not get a return