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. C#
  4. How to use design pattern for calling multiple assemblies

How to use design pattern for calling multiple assemblies

Scheduled Pinned Locked Moved C#
tutorialquestionhtmldesignregex
5 Posts 2 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.
  • M Offline
    M Offline
    mpavas
    wrote on last edited by
    #1

    Hello, I have a project which uses various different assmeblies for each task for example: Crop pdf - assembly Write Word - assembly Create excel and convert to HTML - assembly Now there can be n number of assemblies which will be used based on some condition. I have two questions as below: What kind of pattern will be best suited for this? How can I make sure that the code written by each individual for each assembly do not have a common code in place.

    Regards, Pavas

    N 1 Reply Last reply
    0
    • M mpavas

      Hello, I have a project which uses various different assmeblies for each task for example: Crop pdf - assembly Write Word - assembly Create excel and convert to HTML - assembly Now there can be n number of assemblies which will be used based on some condition. I have two questions as below: What kind of pattern will be best suited for this? How can I make sure that the code written by each individual for each assembly do not have a common code in place.

      Regards, Pavas

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      mpavas wrote:

      What kind of pattern will be best suited for this?

      Create a common interface which all your assemblies has to implement. You can use Factory pattern and return the interface instance. pseudo code follows

      Interface ITask{
      void DoTask();
      }

      ITask task = TaskFactory.GetTask(TaskIdentifier)
      task.DoTask()

      TaskFactory.GetTask will check the conditions and load relevant assemblies using reflection and return it's instance.

      mpavas wrote:

      How can I make sure that the code written by each individual for each assembly do not have a common code in place.

      This is not clear. Can you explain?

      Navaneeth How to use google | Ask smart questions

      M 1 Reply Last reply
      0
      • N N a v a n e e t h

        mpavas wrote:

        What kind of pattern will be best suited for this?

        Create a common interface which all your assemblies has to implement. You can use Factory pattern and return the interface instance. pseudo code follows

        Interface ITask{
        void DoTask();
        }

        ITask task = TaskFactory.GetTask(TaskIdentifier)
        task.DoTask()

        TaskFactory.GetTask will check the conditions and load relevant assemblies using reflection and return it's instance.

        mpavas wrote:

        How can I make sure that the code written by each individual for each assembly do not have a common code in place.

        This is not clear. Can you explain?

        Navaneeth How to use google | Ask smart questions

        M Offline
        M Offline
        mpavas
        wrote on last edited by
        #3

        Thanks, The last question was: There are 10 developers writing different assemblies. Now how can we make sure they do not use duplicate codes.. I guess we need to fist list out all the different methods hence we can re-use them. Thanks for the suggestion

        Regards, Pavas

        N 1 Reply Last reply
        0
        • M mpavas

          Thanks, The last question was: There are 10 developers writing different assemblies. Now how can we make sure they do not use duplicate codes.. I guess we need to fist list out all the different methods hence we can re-use them. Thanks for the suggestion

          Regards, Pavas

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          mpavas wrote:

          Now how can we make sure they do not use duplicate codes

          What do you mean by duplicate code? You should conduct meetings with the team members and decide how each one has to code. Peer reviews also will work.

          Navaneeth How to use google | Ask smart questions

          M 1 Reply Last reply
          0
          • N N a v a n e e t h

            mpavas wrote:

            Now how can we make sure they do not use duplicate codes

            What do you mean by duplicate code? You should conduct meetings with the team members and decide how each one has to code. Peer reviews also will work.

            Navaneeth How to use google | Ask smart questions

            M Offline
            M Offline
            mpavas
            wrote on last edited by
            #5

            Yes, Thanks for answering the stupid question. I also thought that after posting the question :)

            Regards, Pavas

            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