Jump to content

Search the Community

Showing results for tags 'solid'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am refactoring a class that has multiple responsibilities. After reading Single_responsibility_principle, I am still not sure, how to factor out the class into its aspects. The methods of the class are (summarized): class constructor Calculate {General, A, B} Convert {General, A, B} Load {General, C, D} Save {General, C, D} By General I mean i.e. load() function that can load A or B or both depending on the circumstances, and by A or B I mean more specific loadA(), or loadB(). My specific questions in regards to SRP is: Do `load()` and `save()` belong to different classes, because they can in theory change at different times for different reasons, or can/should I put them into the same class, because loading/saving can be considered as "database operations" and if one changes so *may* the other, i.e. adding a new attribute to whatever is being saved/loaded? How do I organize the classes anyway? i.e. something like this? class CalculateGeneral() {}; class CalculateA() extends CalculateGeneral {}; class CalculateB() extends CalculateGeneral {}; class ConvertGeneral() {}; class ConvertA() extends ConvertGeneral {}; class ConvertB() extends ConvertGeneral {}; class LoadSaveGeneral() {}; class LoadC() extends LoadSaveGeneral{}; class LoadD() extends LoadSaveGeneral{}; Woah that's 9 classes out of 1 that it is now..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.