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.

Similar Messages

  • Possible design patterns for base function with possible additions

    I have various interfaces i have to implement. Let's assume ITypeA, ITypeB. They have following methods:
    ITypeA
    Connect
    Disconnect
    GetData
    SetData
    ClearData
    ITypeB
    Connect
    Disconnect
    GetData
    SetData
    Start
    Pause
    Stop
    They have some base functionality: Connect, Disconnect, GetData and SetData.
    If I want to add ITypeC in the future, it will have these base functionality too.
    I want to access to the base functionality and if there is additional functionality, I want to get this too. What design patterns are available that are capable of this situations?
    I found one here: Extension Interface. In this, you create a base
    interface and multiple extension interfaces that are implementing the additional functions. In the base interface you can ask for the available extension interfaces of the component. But this approach seems complicated: I have to create interfaces for each
    type, factories for the interfaces, I need some tables to save what Interface belongs to what Factory...
    What is the basic solution for this problem? Extension Interfaces? Are there any other possible alternatives for my problem?

    You may have more joy dividing your interfaces by behaviour and deciding on the types later.
    interface IConnectable
    Connect
    Disconnect
    interface IDataTransferrable
    GetData
    SetData
    interface IPlayable
    Start
    Pause
    Stop
    class TypeA : IConnectable, IDataTransferrable
    class TypeB : IConnectable, IDataTransferrable, IPlayable
    And then how can discover if your object supports these interfaces?
    here's one way:
    if (ob is IPlayable)
    Playback(ob);
    where you have a function:
    void Playback(IPlayable ob)

  • 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

  • What are the best practices in design patterns?

    What design patterns are likely popular?

    If you go to your local bookstore or online book store you will find at least 20 books that describe this.
    Some how I doubt you are going to get 20 books worth of an answer.

  • ABAP Object X Design Patterns X Extreme Program

    Hi Evebody,
    I’m postgraduate in Object Oriented Analysis and Programming.
    I’ve been working with ABAP procedural development for two years and I’ve started to work with ABAP Objects has few months.
    I’d like to get deeply knowledge in my development’s skills, could someone tell me if <b>ABAP Object X Designer Patterns X Extreme Program</b> is a good path to follow?
    I’d like to share material and guides about this topic.
    I’ve already bought these books to help me.
    <b>ABAP Objects</b> - H. Keller; Hardcover <i>(Pre-Order)</i>
    <b>Design Patterns Explained</b> - Alan Shalloway
    I’ll be very grateful with any help.

    > And do you think these themes are a great combination
    > for ABAP development?
    Design pattern are very abstract and can be used with any OO programming language. The implementations will differ but the core concepts are always the same.
    XP is an agile development process and can also be used with any programming language.
    Learning what design pattern are and how to use them is very important in my opinion. Most companies expect that you are familiar and have experience with them.
    Extreme Programming (XP) on the other side is different. When I began to explore XP it got me started on how software should be developed in general. Since the concepts behind XP are quite different, it should at least stimulate you to start thinking about how you develop software at the moment and if there might be better ways of doing it.
    If you have only time to study one subject go for the design pattern. You might also consider reading the following books if you want to improve your OO coding skills:
    <a href="http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=pd_bbs_sr_1/102-4989641-7820932?ie=UTF8&s=books&qid=1173448197&sr=8-1">Refactoring: Improving the Design of Existing Code (a true classic)</a>
    <a href="http://www.amazon.com/Refactoring-Patterns-Addison-Wesley-Signature-Kerievsky/dp/0321213351/ref=pd_bbs_sr_2/102-4989641-7820932?ie=UTF8&s=books&qid=1173448197&sr=8-2">Refactoring to Patterns (Shows how to improve code by introducing design pattern)</a>
    cheers
    Thomas

  • Design patterns in log4j

    hi
    i have a question that was asked to me
    what pattern does log4j appender(consoleappender,rollingfileappender etc) implement?
    candidates can be dao, facade etc....
    can somebody xplain what pattern does it use and how
    techy

    actually this question was given in an exam and the
    answer that the teacher gave was proxy pattern.Actually, if you think about it, only the individuals that programmed the log4j code know what design patterns they actually used.
    As an outsider, just because an application "looks" like a pattern might have been used, does not mean it was actually used to design the application.
    Futhermore, just because an application's functionality may fit in well with how one envisions the pattern's possible implementation, this too, does automatically equate or represent the fact that the pattern(s) were used.
    This is a poor question to have on an exam, especailly if the individuals taking the exam were not the ones that worked on log4j. If the exam was given to log4j programmers, then it is a reasonable question.
    To ask this question to assess knowledge/experience with log4j or object-oriented design patterns is a bad decision, in my opinion.
    Only close and detailed inspection of the log4j source code will reveal what design patterns were actually used. Again, to question someone on this is inappropriate, unless it is for the log4j development team, in my opinion.
    i m not able to understand how it applies proxy
    pattern?I understand your confusion.

  • Design patterns in portlet development

    Hello,
    I am a student at the Technical University in Munich, Germany and I am working on a university project on design patterns for portlets.
    The focus of my work is researching the best practices when developing a web portlet, especially which design patterns are the most suitable for portlets development.
    For example, the MVC pattern is one of the most popular design patterns for portlets.
    I am writing to you to ask which design patterns are used in the development of your portlets from the SAP Enterprise Portal.
    - What design patterns do you use for your portlets?
    - Do you use MVC among others?
    - Do you have your own design patterns?
    - Do you use any templates or guidelines for portlet development that involve design patterns?
    I am looking forward to your answer. Any answer would help with the research, as experts’ interviews are part of my work in the project.
    I appreciate any references you consider to be related to my search.
    Thank you,
    Julia Alexandrescu
    Department of Informatics
    Technical University Munich
    Email: [email protected]

    Hi raaj,
    I have a query related to this.
    I am a beginner to portlets.
    Say I have an existing struts application.What all do i need to modify or add to make a .portlet file out of it so as to make it deployable in Weblogic 8.1 SP3?
    Is adding a portlet.xml enough?
    if yes, what would the portlet.xml look like?
    Do i need to add a separate class as well?
    I couldnt get any sufficient answers from other forums.
    Can you please help?
    Thanks & Regards,
    Nishant

  • Design patterns in WLI

    What design patterns could provide the best reuse of business processes and messaging infrastructure?

              Hi.
              I recently bought WROX Press book Professional J2EE EAI, which discusses Enterprise
              Integration. Maybe not on a Design Pattern-level (if there is one), but it gave
              me a good overview and helped me make some desig decisions. I´m not sure if its
              technical enough for those used to such decisions, but it proved useful to me.
              http://www.wrox.com/ACON11.asp?WROXEMPTOKEN=87620ZUwNF3Eaw3YLdhXRpuVzK&ISBN=186100544X
              HTH
              Oskar
              

  • 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.

  • 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

  • Design pattern of servlet context

    hi all
    can u please tell me what design pattern is used in servlet context.
    thanks

    http://www.google.com/search?hl=en&client=netscape-pp&rls=com.netscape%3Aen-US&q=design+pattern+for+servlet+&btnG=Search

  • 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

  • Design pattern for a stand alone J2SE app

    What are the different options available for designing an interface type of stand alone application ? Can we use a scaled down version of MVC ? This is purely J2SE.
    Any info will be highly appreciated. Thanks in advance.

    Hope this is going to clear it .. Say for simple example I need to write an application to extract data out of a database and send it over to another application . That is going to be a standalone application probably very simple ( sometimes it could be complex ). What design pattern can be used in that context ? Remember this is not a web or GUI type of application. Hope this makes it more clear .... Thanks

Maybe you are looking for