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.
  • 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
      • V Vikram A Punathambekar

        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 Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #23

        Vikram A Punathambekar wrote:

        I was surprised nobody else noticed.

        On my reply to Cristoph, I already said we could have overloads.

        Rajesh R Subramanian wrote:

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

          A Offline
          A Offline
          Al Beback
          wrote on last edited by
          #24

          I would consider: getCorrelation(bool historic); getRollDate(bool historic); along with getCorrelation(); // calls above with false getRollDate(); // calls above with false Cheers.

          - Is God willing to prevent evil, but not able? Then he is impotent. - Is he able, but not willing? Then he is malevolent. - Is he both able and willing? Whence then is evil? - Is he neither able nor willing? Then why call him God? Epicurus

          V 1 Reply Last reply
          0
          • A Al Beback

            I would consider: getCorrelation(bool historic); getRollDate(bool historic); along with getCorrelation(); // calls above with false getRollDate(); // calls above with false Cheers.

            - Is God willing to prevent evil, but not able? Then he is impotent. - Is he able, but not willing? Then he is malevolent. - Is he both able and willing? Whence then is evil? - Is he neither able nor willing? Then why call him God? Epicurus

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

            Not quite. Historic data should be available for a few years, so the date has to be specified. I'm gravitating towards what the other guy said - one overload that takes a date parameter.

            Cheers, Vikram.


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

            1 Reply Last reply
            0
            • R Rajesh R Subramanian

              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 Offline
              V Offline
              Vikram A Punathambekar
              wrote on last edited by
              #26

              Rajesh R Subramanian wrote:

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

              History doesn't really make sense. It implies you want the entire bunch of past values. I thought Historic was bang on target (and so did my UK colleague).

              Rajesh R Subramanian wrote:

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

              Not sure I understand what you're saying. :~ I still think getIndexCurveHistoric is better than getHistoricIndexCurve but I will go with the date overload. It will look like this:

              IndexCurve getIndexCurve(string curveID);
              IndexCurve getIndexCurve(string curveID, DateTime asOfDate);

              Cheers, Vikram.


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

              D R 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

                S Offline
                S Offline
                Shog9 0
                wrote on last edited by
                #27

                getCorrelation(string timePeriod) getRollDate(string timePeriod)

                You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

                1 Reply Last reply
                0
                • V Vikram A Punathambekar

                  Rajesh R Subramanian wrote:

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

                  History doesn't really make sense. It implies you want the entire bunch of past values. I thought Historic was bang on target (and so did my UK colleague).

                  Rajesh R Subramanian wrote:

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

                  Not sure I understand what you're saying. :~ I still think getIndexCurveHistoric is better than getHistoricIndexCurve but I will go with the date overload. It will look like this:

                  IndexCurve getIndexCurve(string curveID);
                  IndexCurve getIndexCurve(string curveID, DateTime asOfDate);

                  Cheers, Vikram.


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

                  D Offline
                  D Offline
                  Dan Neely
                  wrote on last edited by
                  #28

                  Vikram A Punathambekar wrote:

                  I still think getIndexCurveHistoric is better than getHistoricIndexCurve but I will go with the date overload. It will look like this:

                  I like this better than any of the other suggestions I've seen.

                  Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull

                  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

                    S Offline
                    S Offline
                    SuperJdynamite
                    wrote on last edited by
                    #29

                    A convention I originally used for SQL, but has permeated into other code, was to not prefix procedures with "Get", "Set", "Update" or the like. Instead I have "CustomerNameSelect()" or "CustomerNameUpdate" instead of "SelectCustomerName()" or "UpdateCustomerName()". In an alphabetical listing I find it's easier to find what you want if all your "CustomerName" operations are lumped together rather than all your Select operations.

                    1 Reply Last reply
                    0
                    • V Vikram A Punathambekar

                      Rajesh R Subramanian wrote:

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

                      History doesn't really make sense. It implies you want the entire bunch of past values. I thought Historic was bang on target (and so did my UK colleague).

                      Rajesh R Subramanian wrote:

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

                      Not sure I understand what you're saying. :~ I still think getIndexCurveHistoric is better than getHistoricIndexCurve but I will go with the date overload. It will look like this:

                      IndexCurve getIndexCurve(string curveID);
                      IndexCurve getIndexCurve(string curveID, DateTime asOfDate);

                      Cheers, Vikram.


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

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

                      Vikram A Punathambekar wrote:

                      History doesn't really make sense.

                      Hmm... My assumption was that you'd send a parameter like CDateTime (I don't know the .net equivalent of it... I guess it is DateTime from your post) to that call. I must have been clear about the parameters though. But, the overloads you've specified in this post looks just perfect.

                      Vikram A Punathambekar wrote:

                      Not sure I understand what you're saying.

                      I'm saying that everyone disagreed with you, because they felt it could have been better. :)

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

                      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