Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Prefix or suffix? [modified * 2]

Prefix or suffix? [modified * 2]

Scheduled Pinned Locked Moved The Lounge
javacomjsonquestion
30 Posts 13 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Vikram A Punathambekar

    I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

    getCorrelationHistoric()
    getRollDateHistoric()

    or

    getHistoricCorrelation()
    getHistoricRollDate()

    I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

    Cheers, Vikram.


    "real dictators don't loose[sic] elections." - Diego Moita.

    modified on Tuesday, February 26, 2008 7:15 AM

    B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #3

    It depends. If I'm coding primarily for myself, and making heavy use of Intellisense, I tend toward using a prefix for grouping, and since historic seems more of a variant of correlation than correlation a variant of historic, I would place correlation first. If I'm coding 'for the public' I would say getHistoricCorrelation, as it has a more naturally descriptive nature.

    1 Reply Last reply
    0
    • V Vikram A Punathambekar

      I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

      getCorrelationHistoric()
      getRollDateHistoric()

      or

      getHistoricCorrelation()
      getHistoricRollDate()

      I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

      Cheers, Vikram.


      "real dictators don't loose[sic] elections." - Diego Moita.

      modified on Tuesday, February 26, 2008 7:15 AM

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #4

      Vikram A Punathambekar wrote:

      getHistoricCorrelation()

      Is more readable IMO However, if you have a lot of differetn Correlations, then the suffix means you get a list of possible options in intellisense. I hate writing code for the intellisense benefits tho, it feels like the wrong thing to be driving the coding style.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      V 1 Reply Last reply
      0
      • V Vikram A Punathambekar

        I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

        getCorrelationHistoric()
        getRollDateHistoric()

        or

        getHistoricCorrelation()
        getHistoricRollDate()

        I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

        Cheers, Vikram.


        "real dictators don't loose[sic] elections." - Diego Moita.

        modified on Tuesday, February 26, 2008 7:15 AM

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #5

        GetHistoricCorrelation() would be my choice. As CG already said, it sounds more meaningful to me.

        Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

        V 1 Reply Last reply
        0
        • C Christian Graus

          Vikram A Punathambekar wrote:

          getHistoricCorrelation()

          Is more readable IMO However, if you have a lot of differetn Correlations, then the suffix means you get a list of possible options in intellisense. I hate writing code for the intellisense benefits tho, it feels like the wrong thing to be driving the coding style.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          V Offline
          V Offline
          Vikram A Punathambekar
          wrote on last edited by
          #6

          Christian Graus wrote:

          However, if you have a lot of differetn Correlations, then the suffix means you get a list of possible options in intellisense.

          Not quite. You have a lot of different types (I only listed 3) and they are all either live or historic. I used historic as a suffix because it only modifies the Correlation, or SpreadCurve, or whatever you need.

          Christian Graus wrote:

          Vikram A Punathambekar wrote: getHistoricCorrelation() Is more readable IMO

          In isolation, I agree. But I think getCorrelation() and getCorrelationHistoric() look better as a pair than getIndexCurve() and getHistoricIndexCurve().

          Christian Graus wrote:

          I hate writing code for the intellisense benefits tho, it feels like the wrong thing to be driving the coding style.

          Actually, when you design/write an API, coding for Intellisense is a huge plus, if not a must. Obviously, I'm not talking about the implementation details of your methods here, but rather the names you choose for them.

          Cheers, Vikram.


          "real dictators don't loose[sic] elections." - Diego Moita.

          R 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            GetHistoricCorrelation() would be my choice. As CG already said, it sounds more meaningful to me.

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #7

            Please see my reply to CG above.

            Cheers, Vikram.


            "real dictators don't loose[sic] elections." - Diego Moita.

            1 Reply Last reply
            0
            • M Malcolm Smart

              a long long time ago, in a galaxy far far away, we did something similar. I came in after the design phase so had no input, but the method they used was to have properties (C#) for the 'phase' obj.current.Correlation // or just obj.Correlation obj.historic.Correlation obj.historic[1927].Correlation obj.future[2].Correlation As you're using get / set, I assume you are not C# but this can be applied to other languages? Never really thought about good or bad design - it was easy to code against, and with the indexers giving the offset, was fairly flexible. I'd give you a really good answer but then that turns into 'code' and I am not doing that in the lounge - i'd drop this in the Design / Architecture forum.

              Knowledge is hereditary, it will find its way up or down. - Luc Pattyn
              so you answer don't be scared of failure The only failure is never to try Things You've Never Done - Passenger -2008

              V Offline
              V Offline
              Vikram A Punathambekar
              wrote on last edited by
              #8

              Sorry, I think I should have been more specific. This is a web service, and these methods go to the database to fetch the requested data. The class containing these methods does not hold any data, hence I can't use properties. Besides, this is in Java.

              Malcolm Smart wrote:

              I'd give you a really good answer but then that turns into 'code' and I am not doing that in the lounge - i'd drop this in the Design / Architecture forum.

              Honestly, I don't know why some people are paranoid about posting any code in the Lounge. After all, this question is simply about suffixes versus prefixes - surely something as innocuous as this doesn't warrant the Arch forum? On a lighter note, the rules only say no programming questions. They don't say no programming answers. ;)

              Cheers, Vikram.


              "real dictators don't loose[sic] elections." - Diego Moita.

              1 Reply Last reply
              0
              • V Vikram A Punathambekar

                I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

                getCorrelationHistoric()
                getRollDateHistoric()

                or

                getHistoricCorrelation()
                getHistoricRollDate()

                I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

                Cheers, Vikram.


                "real dictators don't loose[sic] elections." - Diego Moita.

                modified on Tuesday, February 26, 2008 7:15 AM

                C Offline
                C Offline
                Christoph Menge
                wrote on last edited by
                #9

                So you are 'defaulting' to Live, and Historic is an option, so to speak? I think, its best to use either no defaults, thus creating GetLiveCorrelation(); GetHistoricCorrelation(); which seems clearer to me and is less implicit. Or maybe you put it into different services. Somehow, I feel you are creating a decorator/wrapper of what could easily be two interfaces. For some reason, I really dislike the suffix option, especially when paired with the default option of leaving 'live' out. Cheers, Chris

                "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                Articles  Blog

                R 1 Reply Last reply
                0
                • V Vikram A Punathambekar

                  I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

                  getCorrelationHistoric()
                  getRollDateHistoric()

                  or

                  getHistoricCorrelation()
                  getHistoricRollDate()

                  I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

                  Cheers, Vikram.


                  "real dictators don't loose[sic] elections." - Diego Moita.

                  modified on Tuesday, February 26, 2008 7:15 AM

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #10

                  I prewfer top own (e.g. ZoomIncrease, ZoomDecrease, AxisRangeIncrease, AxisRangeDecrease) over the 'correct' but in my view struxturally garbled IncreaseZoo, DecreaseZoom, IncreaseAxisRange etc. This simply helps with orientiiton, and works better with IDE tools (class browser, intellisense etc.) For your example, I can't derive however if "Historic" would make a sensible group. (Of course it would even be better to have this as subobjects: Zoom.Increase, Zoom.Decrease, etc. but that wasn't the question, right? right?)

                  We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                  blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist

                  1 Reply Last reply
                  0
                  • V Vikram A Punathambekar

                    Christian Graus wrote:

                    However, if you have a lot of differetn Correlations, then the suffix means you get a list of possible options in intellisense.

                    Not quite. You have a lot of different types (I only listed 3) and they are all either live or historic. I used historic as a suffix because it only modifies the Correlation, or SpreadCurve, or whatever you need.

                    Christian Graus wrote:

                    Vikram A Punathambekar wrote: getHistoricCorrelation() Is more readable IMO

                    In isolation, I agree. But I think getCorrelation() and getCorrelationHistoric() look better as a pair than getIndexCurve() and getHistoricIndexCurve().

                    Christian Graus wrote:

                    I hate writing code for the intellisense benefits tho, it feels like the wrong thing to be driving the coding style.

                    Actually, when you design/write an API, coding for Intellisense is a huge plus, if not a must. Obviously, I'm not talking about the implementation details of your methods here, but rather the names you choose for them.

                    Cheers, Vikram.


                    "real dictators don't loose[sic] elections." - Diego Moita.

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #11

                    Look at a bunch of functions like: GetWindowName(), GetWindowClass(), GetWindowState(), SetWindowPos(). Window is an entity here and these functions are performing some action (or querying it for its own state information) on it to yield some result. I generally don't put the entity/type that I am performing an action upon at the end (of course, there can be something like GetWindow(), but that's different). Historic data (is that the term :~ ) is an entity in your case and you may perform various actions on it, like getting the index curve of it, getting the correlation, etc., Similarly, live data is another entity. So, we've got two different entities and we you shall build up functions around them. :) Of course, I know there may be exceptions and I'm just talking in general.

                    Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                    C V 2 Replies Last reply
                    0
                    • V Vikram A Punathambekar

                      I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

                      getCorrelationHistoric()
                      getRollDateHistoric()

                      or

                      getHistoricCorrelation()
                      getHistoricRollDate()

                      I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

                      Cheers, Vikram.


                      "real dictators don't loose[sic] elections." - Diego Moita.

                      modified on Tuesday, February 26, 2008 7:15 AM

                      R Offline
                      R Offline
                      Rama Krishna Vavilala
                      wrote on last edited by
                      #12

                      Vikram A Punathambekar wrote:

                      getHistoricCorrelation()getHistoricRollDate()

                      As the function gets the historic correlation data, it makes sense to name it GetHistoricCorrelation.

                      You have, what I would term, a very formal turn of phrase not seen in these isles since the old King passed from this world to the next. martin_hughes on VDK

                      1 Reply Last reply
                      0
                      • C Christoph Menge

                        So you are 'defaulting' to Live, and Historic is an option, so to speak? I think, its best to use either no defaults, thus creating GetLiveCorrelation(); GetHistoricCorrelation(); which seems clearer to me and is less implicit. Or maybe you put it into different services. Somehow, I feel you are creating a decorator/wrapper of what could easily be two interfaces. For some reason, I really dislike the suffix option, especially when paired with the default option of leaving 'live' out. Cheers, Chris

                        "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                        Articles  Blog

                        R Offline
                        R Offline
                        Rajesh R Subramanian
                        wrote on last edited by
                        #13

                        :doh: I must have read your reply before I replied to Vikram. I've suggested the same thing, but I think my explanation is far more confusing.

                        Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                        1 Reply Last reply
                        0
                        • R Rajesh R Subramanian

                          Look at a bunch of functions like: GetWindowName(), GetWindowClass(), GetWindowState(), SetWindowPos(). Window is an entity here and these functions are performing some action (or querying it for its own state information) on it to yield some result. I generally don't put the entity/type that I am performing an action upon at the end (of course, there can be something like GetWindow(), but that's different). Historic data (is that the term :~ ) is an entity in your case and you may perform various actions on it, like getting the index curve of it, getting the correlation, etc., Similarly, live data is another entity. So, we've got two different entities and we you shall build up functions around them. :) Of course, I know there may be exceptions and I'm just talking in general.

                          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                          C Offline
                          C Offline
                          Christoph Menge
                          wrote on last edited by
                          #14

                          Hey Rajesh, obvioulsy we agree on this :-) I just read a few lines of "Code Complete 2" about naming methods: "To name a procedure, use a strong verb followed by an object" As you pointed out already, "Get" is already a strong verb - so the real question here is whether "Correlation" itself can be regarded as an entity - but that requires some knowledge about the subject matter (which I don't have). However, in "Code Complete", Steve McConnell also points out that in an OO-environment, the method itself does not need to include the object name, because it is included in the invocation such as myHistoricData.GetCorrelation(). I think I'd still go for this, if possible. On the other hand, that might raise question whether to name the class/webService "financialDataHistoric" or "historicFinancialData"... Chris

                          "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                          Articles  Blog

                          R V 2 Replies Last reply
                          0
                          • C Christoph Menge

                            Hey Rajesh, obvioulsy we agree on this :-) I just read a few lines of "Code Complete 2" about naming methods: "To name a procedure, use a strong verb followed by an object" As you pointed out already, "Get" is already a strong verb - so the real question here is whether "Correlation" itself can be regarded as an entity - but that requires some knowledge about the subject matter (which I don't have). However, in "Code Complete", Steve McConnell also points out that in an OO-environment, the method itself does not need to include the object name, because it is included in the invocation such as myHistoricData.GetCorrelation(). I think I'd still go for this, if possible. On the other hand, that might raise question whether to name the class/webService "financialDataHistoric" or "historicFinancialData"... Chris

                            "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                            Articles  Blog

                            R Offline
                            R Offline
                            Rajesh R Subramanian
                            wrote on last edited by
                            #15

                            Christoph Menge wrote:

                            myHistoricData.GetCorrelation()

                            I was thinking of a situation where you're writing this API on the global namespace. So, it made perfect sense to me to have names like ::GetHistoricCorrelation() and ::GetCurrentCorrlation(). Of course, it were a member function, then GetCorrelation() is sweet enough. :) On the perverted side, we can have an overload like ::GetCorrelation(Entity E) if we have too may entities on which we could possibly make this call. :-O

                            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                            1 Reply Last reply
                            0
                            • R Rajesh R Subramanian

                              Look at a bunch of functions like: GetWindowName(), GetWindowClass(), GetWindowState(), SetWindowPos(). Window is an entity here and these functions are performing some action (or querying it for its own state information) on it to yield some result. I generally don't put the entity/type that I am performing an action upon at the end (of course, there can be something like GetWindow(), but that's different). Historic data (is that the term :~ ) is an entity in your case and you may perform various actions on it, like getting the index curve of it, getting the correlation, etc., Similarly, live data is another entity. So, we've got two different entities and we you shall build up functions around them. :) Of course, I know there may be exceptions and I'm just talking in general.

                              Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                              V Offline
                              V Offline
                              Vikram A Punathambekar
                              wrote on last edited by
                              #16

                              Rajesh R Subramanian wrote:

                              Historic data (is that the term ) is an entity in your case and you may perform various actions on it, like getting the index curve of it, getting the correlation, etc.

                              Au contraire. Correlation, IndexCurve, etc are entities, and I'm getting their historic (anything before today) and live (today's) values.

                              Cheers, Vikram.


                              "real dictators don't loose[sic] elections." - Diego Moita.

                              1 Reply Last reply
                              0
                              • C Christoph Menge

                                Hey Rajesh, obvioulsy we agree on this :-) I just read a few lines of "Code Complete 2" about naming methods: "To name a procedure, use a strong verb followed by an object" As you pointed out already, "Get" is already a strong verb - so the real question here is whether "Correlation" itself can be regarded as an entity - but that requires some knowledge about the subject matter (which I don't have). However, in "Code Complete", Steve McConnell also points out that in an OO-environment, the method itself does not need to include the object name, because it is included in the invocation such as myHistoricData.GetCorrelation(). I think I'd still go for this, if possible. On the other hand, that might raise question whether to name the class/webService "financialDataHistoric" or "historicFinancialData"... Chris

                                "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                                Articles  Blog

                                V Offline
                                V Offline
                                Vikram A Punathambekar
                                wrote on last edited by
                                #17

                                Christoph Menge wrote:

                                the real question here is whether "Correlation" itself can be regarded as an entity

                                Yes. SpreadCurve, IndexCurve, Correlation, etc are the entities. I'm building functions to get their historic (anything before today) and live (today's) values.

                                Cheers, Vikram.


                                "real dictators don't loose[sic] elections." - Diego Moita.

                                C 1 Reply Last reply
                                0
                                • V Vikram A Punathambekar

                                  Christoph Menge wrote:

                                  the real question here is whether "Correlation" itself can be regarded as an entity

                                  Yes. SpreadCurve, IndexCurve, Correlation, etc are the entities. I'm building functions to get their historic (anything before today) and live (today's) values.

                                  Cheers, Vikram.


                                  "real dictators don't loose[sic] elections." - Diego Moita.

                                  C Offline
                                  C Offline
                                  Christoph Menge
                                  wrote on last edited by
                                  #18

                                  Hi Vikram, what I meant is: "Is correlation alone a sufficient description for the entity, or is it necessary to call it liveCorrelation?". In essence, I prefer GetHistoricalCorrelation() over GetCorrelationHistorical() like most (all?) of the other posters did. Chris

                                  "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                                  Articles  Blog

                                  V 1 Reply Last reply
                                  0
                                  • C Christoph Menge

                                    Hi Vikram, what I meant is: "Is correlation alone a sufficient description for the entity, or is it necessary to call it liveCorrelation?". In essence, I prefer GetHistoricalCorrelation() over GetCorrelationHistorical() like most (all?) of the other posters did. Chris

                                    "Obstacles are those frightening things you see when you take your Eyes off your aim" - Henry Ford
                                    Articles  Blog

                                    V Offline
                                    V Offline
                                    Vikram A Punathambekar
                                    wrote on last edited by
                                    #19

                                    Christoph Menge wrote:

                                    Is correlation alone a sufficient description for the entity, or is it necessary to call it liveCorrelation?

                                    Actually, yes. A SpreadCurve is an entity by itself. The only thing that differentiates between live and historical SpreadCurves is that the historical ones are from previous days. Thanks for your input; I'm somewhat surprised (and somewhat pleasantly so) to see pretty much everybody actually disagrees. ;)

                                    Cheers, Vikram.


                                    "real dictators don't loose[sic] elections." - Diego Moita.

                                    R 1 Reply Last reply
                                    0
                                    • V Vikram A Punathambekar

                                      I am designing an API, which will (amongst other things) provide live and historic values for many types of data. Let's say the data types will be Correlation, IndexCurve, and RollDate, amongst many others. The methods that get live data will be called getCorrelation(), getIndexCurve(), and getRollDate() respectively (the word **live** will not be part of the name). Would you prefer the methods that deal with historic data (anything before today's data) to be called

                                      getCorrelationHistoric()
                                      getRollDateHistoric()

                                      or

                                      getHistoricCorrelation()
                                      getHistoricRollDate()

                                      I strongly want to keep the modifier as the suffix (i.e., getCorrelationHistoric()) but I'm interested in knowing what you would do, and why. :) [EDIT]If it makes any difference, these methods will be part of a web service. Written in Java ;) [/EDIT] [EDIT2]Added clarifications[/EDIT2]

                                      Cheers, Vikram.


                                      "real dictators don't loose[sic] elections." - Diego Moita.

                                      modified on Tuesday, February 26, 2008 7:15 AM

                                      R Offline
                                      R Offline
                                      Robert Rohde
                                      wrote on last edited by
                                      #20

                                      Are you really planning that these methods don't have any arguments? What about making the difference with some kind of overload? Something like:

                                      getCoorelation() --current
                                      getCorrelation(Date date) --historic correlation of date

                                      Robert

                                      V 1 Reply Last reply
                                      0
                                      • R Robert Rohde

                                        Are you really planning that these methods don't have any arguments? What about making the difference with some kind of overload? Something like:

                                        getCoorelation() --current
                                        getCorrelation(Date date) --historic correlation of date

                                        Robert

                                        V Offline
                                        V Offline
                                        Vikram A Punathambekar
                                        wrote on last edited by
                                        #21

                                        Generally speaking, the methods will have quite a few arguments. They are far from being finalized, though. Great suggestion, I was surprised nobody else noticed. :-D

                                        Cheers, Vikram.


                                        "real dictators don't loose[sic] elections." - Diego Moita.

                                        R 1 Reply Last reply
                                        0
                                        • V Vikram A Punathambekar

                                          Christoph Menge wrote:

                                          Is correlation alone a sufficient description for the entity, or is it necessary to call it liveCorrelation?

                                          Actually, yes. A SpreadCurve is an entity by itself. The only thing that differentiates between live and historical SpreadCurves is that the historical ones are from previous days. Thanks for your input; I'm somewhat surprised (and somewhat pleasantly so) to see pretty much everybody actually disagrees. ;)

                                          Cheers, Vikram.


                                          "real dictators don't loose[sic] elections." - Diego Moita.

                                          R Offline
                                          R Offline
                                          Rajesh R Subramanian
                                          wrote on last edited by
                                          #22

                                          I think in that case GetIndexCurveHistory() and GetIndexCurve(), etc., should fit in right. The word, histor_ic_ is a bit confusing.

                                          Vikram A Punathambekar wrote:

                                          I'm somewhat surprised (and somewhat pleasantly so) to see pretty much everybody actually disagrees.

                                          Everyone disagrees, for a reason, may be? Or you just think that is plain coincidence? :-D

                                          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                                          V 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups