Skip to main content

Home/ InnoDev/ Group items tagged design patterns

Rss Feed Group items tagged

Jozef Fulop

Renderable Null Objects - 0 views

  •  
    Jednoduchy design pattern
Michal Holub

CircuitBreaker design pattern - 0 views

  •  
    Pouzitelny pri volani vzdialenych procesov a sluzieb (cez siet), ktore mozu dostat timeout alebo inak zlyhat.
Juraj Visnovsky

has_many considered harmful - 2 views

  •  
    has_many is an anti-pattern which leads straight to monolithic applications. However, a simple inversion can free us from its grasp. What is the first model you added to your application? Probably User, right? So, once you wrote user.rb and its corresponding tests, and committed it - why did you ever open that file up again to tell it about something that it did not need to know existed? Rails keeps you from reopening user.rb if you add a column to the User table, and this is good, right? So why, when you added a Posts table far away, did you open up User again to make it aware of Posts? Did the definition of being a user change? Did you did not realize you were violating the Open-Closed Principle, one of the 5 principles of SOLID design? Somewhere inside I bet you knew it felt dirty to keep opening up User and making it aware of things that it had been blissfully unaware of.
1 - 3 of 3
Showing 20 items per page