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. General Programming
  3. Design and Architecture
  4. In fear of bloated Statergy Pattern Implementations

In fear of bloated Statergy Pattern Implementations

Scheduled Pinned Locked Moved Design and Architecture
cssdesignalgorithmsdata-structuresregex
4 Posts 4 Posters 0 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.
  • P Offline
    P Offline
    popchecker
    wrote on last edited by
    #1

    I am working on a CSS parser which requires to implement each algorithm to parse different CSS selectors. So I saw a Statergy Pattern there. Everything working perfect and satisfies the Open/Closed principle. If But now I concern about the rising number of this statergy pattern implementations. Also I am expected to include few more in near future. I can implement this in a different method like an array of Func methods. Each Func method will encapsulate the algorithm to parse different CSS selectors. To me, this implementation is more primitive than Object Oriented approach. Before analyzing the performace like aspects, I just want to know which one is more adaptable. It is difficult for me to judge which one is more better design. Can you please help me on this?

    L Richard DeemingR J 3 Replies Last reply
    0
    • P popchecker

      I am working on a CSS parser which requires to implement each algorithm to parse different CSS selectors. So I saw a Statergy Pattern there. Everything working perfect and satisfies the Open/Closed principle. If But now I concern about the rising number of this statergy pattern implementations. Also I am expected to include few more in near future. I can implement this in a different method like an array of Func methods. Each Func method will encapsulate the algorithm to parse different CSS selectors. To me, this implementation is more primitive than Object Oriented approach. Before analyzing the performace like aspects, I just want to know which one is more adaptable. It is difficult for me to judge which one is more better design. Can you please help me on this?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      popchecker wrote:

      If But now I concern about the rising number of this statergy pattern implementations.

      Why? There's also a rising amount of code. The amount does not say much in itself - if the usage is justified, it is not bloat. If it is there just to say "look, I'm doing patterns" without adding value (there's always cost) then it is bloat.

      popchecker wrote:

      o me, this implementation is more primitive than Object Oriented approach.

      A parser might be handy.

      popchecker wrote:

      I just want to know which one is more adaptable.

      Which approach compared to which other approach?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      1 Reply Last reply
      0
      • P popchecker

        I am working on a CSS parser which requires to implement each algorithm to parse different CSS selectors. So I saw a Statergy Pattern there. Everything working perfect and satisfies the Open/Closed principle. If But now I concern about the rising number of this statergy pattern implementations. Also I am expected to include few more in near future. I can implement this in a different method like an array of Func methods. Each Func method will encapsulate the algorithm to parse different CSS selectors. To me, this implementation is more primitive than Object Oriented approach. Before analyzing the performace like aspects, I just want to know which one is more adaptable. It is difficult for me to judge which one is more better design. Can you please help me on this?

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        popchecker wrote:

        I am working on a CSS parser ...

        Before you re-invent the wheel, have you seen this project[^]?


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • P popchecker

          I am working on a CSS parser which requires to implement each algorithm to parse different CSS selectors. So I saw a Statergy Pattern there. Everything working perfect and satisfies the Open/Closed principle. If But now I concern about the rising number of this statergy pattern implementations. Also I am expected to include few more in near future. I can implement this in a different method like an array of Func methods. Each Func method will encapsulate the algorithm to parse different CSS selectors. To me, this implementation is more primitive than Object Oriented approach. Before analyzing the performace like aspects, I just want to know which one is more adaptable. It is difficult for me to judge which one is more better design. Can you please help me on this?

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          popchecker wrote:

          If But now I concern about the rising number of this statergy pattern implementations

          10? 1000? 100,000?

          popchecker wrote:

          Before analyzing the performace like aspects

          I would expect that profiling would determine that implementation methodology of accessing the functionality would have zero impact (just noise) for either method The functionality represented by each and the usage to which each is put would be the problem. If there even is a problem.

          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