Strip off specific parameter from URL’s querystring

The safest “correct” method would be: Parse the url into an array with parse_url() Extract the query portion, decompose that into an array using parse_str() Delete the query parameters you want by unset() them from the array Rebuild the original url using http_build_query() Quick and dirty is to use a string search/replace and/or regex to … Read more

What to use? MVC, MVP or MVVM or…?

Actually, the ultimate post you’re looking for is this answer this answer from Karsten Lentzsch (of JGoodies fame) in the Swing Frameworks and Best Practices Swing Frameworks and Best Practices thread. Hello, I’ve been writing Swing apps for several years that many people find elegant. And I teach developers in working with Swing efficiently: how … Read more

Looking for clean WinForms MVC tutorial for C# [closed]

Derick Bailey (via Los Techies) has blogged some fantastic articles (and complete demo source code) for his implementation of MVP in a WinForms app with a couple of other good patterns added to the mix (Application Controller, Event Aggregator). The work is inspired by Jeremy D Miller’s series of articles titled ‘Build Your Own CAB’

Difference between Observer, Pub/Sub, and Data Binding

There are two major differences between Observer/Observable and Publisher/Subscriber patterns: Observer/Observable pattern is mostly implemented in a synchronous way, i.e. the observable calls the appropriate method of all its observers when some event occurs. The Publisher/Subscriber pattern is mostly implemented in an asynchronous way (using message queue). In the Observer/Observable pattern, the observers are aware … Read more

How can I serve a PDF to a browser without storing a file on the server side?

The people who advise you to use response.getOutputStream() instead of creating a FileOutputStream are right. See for instance the Hello Servlet from Chapter 9 of my book: public class Hello extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(“application/pdf”); try { // step 1 Document document = new Document(); // … Read more

Laravel 3 : Looking for explanation how to use the model

The best statement on the subject of Frameworks I’ve heard is due to Uncle Bob: A good Architecture allows major decisions to be deferred! Specifically: A good Architecture delays choosing a Framework! Another great piece to think about: MVC is not an Architecture! It is a Delivery Design Pattern. Watch his video – it is … Read more

Ruby on Rails Best practices – Big Controller vs Small Controller

This is more of a long-form comment, since it explains the origin of your dilemma, but provides no solutions. The problem actually is caused by misinterpretation of MVC, which RoR popularizes. It is the combination of two factors, which are causing this implosion of controller: On the one side you have anemic model, because, instead … Read more

in MVC, where do you draw the line between a controller and model? [closed]

The line between controller and model is actually quite clear. Model is your application’s heart. It contains the business/domain logic required to solve the problem your application was written for. The Model is usually layered into several other layers, e.g. persistence, services, domain, etc. It’s a common misconception that the Model is just the database, … Read more

tech