Results 1 to 12 of 12

Thread: Good Design Parameter

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Good Design Parameter

    Locality
    Not repeating code
    Modifying program means modifying one aspects

    What else?

  2. #2

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Good Design Parameter

    I need more detail.

  4. #4

  5. #5
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Good Design Parameter

    See if some of my tips help you in any way:
    http://pradeep1210.wordpress.com/201...ing-practices/


     
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  6. #6
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Good Design Parameter

    I guess you have to start first with a certain design patern and build up from there:
    http://en.wikipedia.org/wiki/Design_...puter_science)

  7. #7
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Good Design Parameter

    I prefer to keep my SQL in one module (shared class), use the UI to do simple validation and just copy to and from classes which contain the bulk of validation (business rules). This is called the N-tier model. Any functions used by more than one object I either put in their own module, or in a base class. For the classes that represent business objects I implement a common interface.

    As far as good design, you can create arguments on what is good because some aspects are only good depending on the project. And programming is 50% art and 50% science. The main thing is to be consistent, don't be afraid to evolve to remain consistent (don't fail to improve your app or coding style to stay consistent if their are clear benefits), and ensure it is clear as to what you are doing not only for the person who follows you but also for yourself.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Good Design Parameter

    I think this is a good start
    http://en.wikipedia.org/wiki/Don%27t_Repeat_Yourself

    Do not repeat yourself.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Good Design Parameter

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Good Design Parameter

    Another great answer. But that single responsibility principle. Does that work for vb.net given that vb.net don't support multiple inheritance?

    Also about code refactoring.

    Often I see that my project need a file. I add that file and found out that the file need another file. Finally my project are often filled with files and function that it never uses.

    Is there something like refactoring rules I can learn?

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Good Design Parameter

    Quote Originally Posted by teguh123 View Post
    Another great answer. But that single responsibility principle. Does that work for vb.net given that vb.net don't support multiple inheritance?
    SRP and single/multiple inheritance have nothing to do with each other. SRP says that each class or method should have a single responsibility. For instance, you don't create a class that downloads files from the internet and retrieves data from a database. If you are in a situation where you need both those things, then you create one class whose single responsibility it is to do one of them, another class it is to do the other and then a third class whose single responsibility it is to host the other two.
    Quote Originally Posted by teguh123 View Post
    Also about code refactoring.

    Often I see that my project need a file. I add that file and found out that the file need another file. Finally my project are often filled with files and function that it never uses.

    Is there something like refactoring rules I can learn?
    Again, those are two concepts that are unrelated. Refactoring means changing the implementation without changing the interface. Often times you will write code just to get a job done, without caring exactly how. Once you get it to work, then you refactor the code to make the implementation cleaner. In fact, refactoring is a practise that you can use to ensure that you are using the SRP. You might write a method to get a job done and later refactor that single method into multiple methods that each have a single responsibility.

    What you're talking about is just something that you have to live with at times. I think you're over-dramatising it a bit though. There are times where referencing one library will require that you reference another too, but such occasions are not common. The only one I can actually think of in my 8 year .NET development career is when using the Entity Framework. There may have been others but they are obviously few and far between if they're so hard to recall.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Good Design Parameter

    Quote Originally Posted by jmcilhinney View Post
    SRP and single/multiple inheritance have nothing to do with each other. SRP says that each class or method should have a single responsibility. For instance, you don't create a class that downloads files from the internet and retrieves data from a database. If you are in a situation where you need both those things, then you create one class whose single responsibility it is to do one of them, another class it is to do the other and then a third class whose single responsibility it is to host the other two.Again, those are two concepts that are unrelated. Refactoring means changing the implementation without changing the interface. Often times you will write code just to get a job done, without caring exactly how. Once you get it to work, then you refactor the code to make the implementation cleaner. In fact, refactoring is a practise that you can use to ensure that you are using the SRP. You might write a method to get a job done and later refactor that single method into multiple methods that each have a single responsibility.

    What you're talking about is just something that you have to live with at times. I think you're over-dramatising it a bit though. There are times where referencing one library will require that you reference another too, but such occasions are not common. The only one I can actually think of in my 8 year .NET development career is when using the Entity Framework. There may have been others but they are obviously few and far between if they're so hard to recall.
    And finally my list manipulator program have codes that encode automatic posting to wordpress. Something is just wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width