separation-of-concerns

TDD, creating layer of abstraction

Hi guys, Basically, there is a system at my work place that provides OCR capabilities. The process is that, a third party application is configured to display a captured screen (during the OCR process) and a user sits at the pc making sure the captured data is correct. This capture stage has validation on each of the fields. for exampl...

Separated Presentation on a UI Centric Application

Hello all, I having trouble figuring out the correct architecture for this kind of application: it's a diagramming application, which resembles MS Visio. The diagrams are used to generated data which is passed to another application. When designing applications, I've always tried to used layering, but now I can't decide how to do this ...

Learning New Concepts or syntax.

I want to learn new concepts in .NET. I have taken my old ecommerce website and reimplemented it using different concepts. Its one "Hello World" Website for each technology. I am hoping to learn "syntax",separation of tiers,testing, performance and code generation. Different databases like relational and NoSql. Objective is to touch dept...

How much directory separation should my framework have?

Hey guys, just a small question here.. (hopefully!) I've been trying a bunch of different directory structures for my PHP MVC framework. While doing this, I thought of a few reasons to separate different parts of the application from each other. For instance, let's say this is my current structure: - index.php - private/ - applica...

Separation of concerns dilemma in Rails

I'm trying to make logging for my rails app and have some dilemmas over philosophy used in rails. My app has Link model which has_many Hits: class Link < AR::Base has_many :hits end class Hit < AR::Base belongs_to :link end Now each time the link is being hit, I call hit! method to record a request on the link (to keep the contro...

pass parameter to repository while maitaining separation of concerns

Hi all. I'm new to mvc and this whole way of programming is pretty unfamiliar for me, so be gentle ... I have in my article repository: public IQueryable<Article> GetArticles(int? category, int? position) { return from a in dc.Articles where a.LanguageIndex == lang && a.CategoryIndex == category && a.ArticlePosition == p...

Preferred way to combine PHP and HTML?

I learned PHP by hacking away at phpBB2, even submitting a few mods to their database, which others downloaded and used. (I don't believe phpBB2 is supported any more with phpBB3 out so long now, so the v2 mods database is no more.) One of my favorite things about phpBB was their templates system, which let the editor completely separat...

Does Dependency Injection (DI) rely on Interfaces?

This may seem obvious to most people, but I'm just trying to confirm that Dependency Injection (DI) relies on the use of Interfaces. More specifically, in the case of a class which has a certain Interface as a parameter in its constructor or a certain Interface defined as a property (aka. Setter), the DI framework can hand over an inst...

Unit testing functions with side effects?

Let's say you're writing a function to check if a page was reached by the appropriate URL. The page has a "canonical" stub - for example, while a page could be reached at stackoverflow.com/questions/123, we would prefer (for SEO reasons) to redirect it to stackoverflow.com/questions/123/how-do-i-move-the-turtle-in-logo - and the actual r...

WebApplication Architecture - Advice on keeping HTTPContext in the Presentation layer

The majority of the Application Architecture advice seems to advise strongly that only Presentation Layer should have access to HTTPContext (to promote loose coupling, decrease dependencies, increase testability etc). So, how do people deal with Caching and Session? Very specific DataAccess and Business Logic knowledge is required to de...

Separation of Concerns when adding new types

I have a system I've been working on this week where I'm having a hard time balancing separation of concerns with easy extensibility. I'm adding new types to the system, and it feels like shotgun surgery. The basic idea is that data is collected (polled) from a remote system and then made available to a number of different kinds of cli...

How to organize business logic (domain model)

Let's say you have good separation of concerns for a given application such that you have all of your business logic in a single project (let's call it MyApp.Core) and that project has no explicit dependencies on other projects. The repository implementations are in MyApp.Infrastructure and the presentation is in MyApp.UI. Unit tests a...

Does Queryability and Lazy Loading in C# blur the lines of Data Access vs Business Logic?

I am experiencing a mid-career philosophical architectural crisis. I see the very clear lines between what is considered client code (UI, Web Services, MVC, MVP, etc) and the Service Layer. The lines from the Service layer back, though, are getting more blurred by the minute. And it all started with the ability to query code with Linq...

MVC: Are Models and Entity objects separate concepts?

I asked here a while ago for some help in understanding MVC, since I'm very new to the topic. I thought I had a decent understanding of it, and this is documented in a blog post I wrote recently on the subject. My understanding basically boils down to this: Controller: Determines what needs to be done to fulfill a request, and utilizes ...

Does this Rails 3 Controller method make me look fat?

This is a new application, and I have an index method on a Search controller. This also serves as the home page for the application, and I'm trying to decide if I am headed down the wrong path from a design pattern perspective. The method is already 35 lines long. Here is what the method does: 3 lines of setting variables to determine...