Tag Info

Hot answers tagged

5

Consider the model being just data. It doesn't make choices, and it doesn't know how to render. A product can be a model. A list of products can be a model. A bundle containing the list of products, the cart and the information about the current user is a model. The last model from the list corresponds to the data you need to render the page, but it ...


4

Patterns Abstract Details, not Vice Versa The clients will behave as "slaves", that is, they will only connect to server and from then on, only the server communicates with them. Eventually the server may request that the clients send "data streams ... MVC and MVP, ... don't seem to be designed to fulfill my specific requirements." I'm getting the ...


4

The best way to handle multiple conversions like that is to create a Unit of Measurement type class for your application. The UoM class will allow you to encapsulate all of those intricacies within a single area, and the rest of the code can simply call in and specify the units they need the value to come back in. Essentially, what that does is it ...


3

REST does not mean to not use URL params at all. Your example demonstrates this very well. You can still see a 'search' as a REST resource. You implement a controller for it, though it only has one or two actions. (But details do not matter much in this case) Everything data needed to perform the search can then be sent by using params. There is nothing ...


3

Never store strings like 4 x 13/16" screws in your code or your database. Make it a placeholder string like 4 x {0} screws, pass it around with the actual value in internal units (in your case US inches), and only when your program finally presents this to the user, it will replace the placeholder by a value either in inches or mm (according to what is ...


3

I think you got Fowler wrong, he is advocating 3, not 1 (see http://www.martinfowler.com/bliki/AnemicDomainModel.html). Note that he is not talking about "business logic inside entity classes", he is talking about "business logic inside domain classes". And Service objects are domain objects. In your example above: if you need to calculate the orders total, ...


3

First of all, what you're talking about is a design pattern. What this means is you constrain yourself to only doing certain manipulations in order to make your application more readable and maintainable. Keeping things separate, with specific purposes for each component will help to this end. As for your specific question, it sounds fine to me. You don't ...


2

Obviously you could, at application start, seed your database with the roles needed ... I would suggest that you should be doing this at installation time, not application start-up. A "user-level" connection probably shouldn't have permission to make that sort of change anyway. ... there's still a fragile dependency on the data in the database ... ...


2

Your thoughts are not wrong. In MVC web-frameworks, people often speak of a Base Controller that performs the routing of a request to the actual Controller that handles the request. This has come about because web frameworks generally have a single point where the request is received by the application and in pure MVC terms, this is where the job of the ...


2

To take a step back, I think that you may be over-complicating things with your design. You mention an MVC pattern at the beginning, so I'm assuming that you're knowledgeable about web-frameworks and high level designs. You should neatly tuck that away and put it in your pocket. When working on an embedded system, you are making some serious tradeoffs ...


1

Here, use one of these (ViewBag, ViewData, etc): http://forums.asp.net/t/1893283.aspx?What+is+ViewData+and+ViewBag+in+ASP+Net+MVC4+and+what+is+use+and+with+examle+ If you can't stick with the pattern at least work within it...


1

Your basically asking what the implications of breaking the MVC pattern are. You can write an application in anyway you want. However, the advantage of using a pattern like MVC is that it is widely known. Any programmer who understands MVC can look at your application and say "Yes, I understand how the data flows throughout your application and I can add ...


1

As the business logic for these helper components will likely differ from project to project, I would split those helpers into two parts: One part that must be implemented by each project separately and that provides answers to business-logic questions like: "should I show this control". A second, reusable, part that does not contain any actual business ...


1

You should look into Spring4D as it already contains nullable types (similar implementation as yours with a little extra operator overloading) and way more powerful collection types than those in the RTL. They are also interfaced based which is very handy because you don't have to worry about lifetime management especially when passing them around. For ...


1

I tend to think that's a bit silly. More formally, it's an example of what I would call "speculative generality". The counterargument would be that the architecture you describe allows for other sorts of clients to be easily plugged into the same system with less effort, and that one never really knows what sort of new direction the project might take. ...


1

There is a development process question which should be understood and answered before worrying too much about the code. IMHO, any organisation which employes more than one software developer, and especially one using interns to develop code, should have sane, rational, understood, shared development processes. There is a tremendous amount of evidence that ...



Only top voted, non community-wiki answers of a minimum length are eligible