Geeks With Blogs
Mike Nichols - SonOfNun Technology If I were the captain on a big steamboat... June 2006 Entries
Session data pattern for multi-layered apps and Model-View-Presenter ASP.NET strategies
In a previous post, I asked if anyone had a good pattern for accessing Session data from a lower layer (ie, Service Layer) in a multi-layered ASP.NET app WITHOUT reference System.Web. This would be handy to manage all session data from a lower level. Greg Young kindly replied and pointed me in a great direction that led to a pattern I am happy with now. The first task is to implement an interface that we'll use to abstract away the Session implementation: public interface ISessionDataProvider { object ......

Posted On Friday, June 30, 2006 2:57 PM

Finding calling method using reflection
There's probably a more elegant way to do this, but I wanted to find out which method had called the current method for logging. For example, I am calling a method in my DAO and i want to know which method from my Service layer called it...the Stack trace caught during an exception cuts me off and I could only find snippets of getting the current method name for logging purposes. So, here's a method I drummed up to get the name of the calling-calling method: /// <summary> /// Helper method ......

Posted On Thursday, June 29, 2006 10:23 PM

NUnit Tracer, NHibernate NUnit base class and other lessons
I have finally gotten smart and started using NUnit to drive my coding. Man, I can already see big improvements in how it guides my focus and design: Forces me to make design decisions, even if only partially or as stubs, for my tests to be relevant Builds on confidence I have on existing solid code...complex logic can be digested in bites now IT's EASY to use! One thing I had to figure out was implementing my own Trace Listener so I could write out things like property values or other stuff during ......

Posted On Thursday, June 29, 2006 9:35 PM

Design Patterns Knowledge
Just read a great post on Jeremy Miller's blog. He offers some general ways to get started learning design patterns in coding. Having started with Microsoft technologies, I felt overwhelmed by all the "stuff" that was needed to be done for what I thought should be simple operations...this is mostly because Microsoft doesn't encourage a knowledge of design patterns in all their examples and literature. This is changing now, I realize, but they are way behind the Java folks as far as I can tell (google ......

Posted On Thursday, June 29, 2006 11:34 AM

Generic DTO Assembler
Playing around with incorporating Data Transfer Objects into my project, I figure I can use a touch of reflection to manage most assembler cases which are called from my service layer. May be a tad slower, but worth the savings for coding a million assembler classes. My base assembler has some basic methods for mapping simple properties to my entities suchas : using System; using System.Collections.Generic; using System.Text; using Cei.eMerge.Core.Domain; using Cei.eMerge.Core.DaoInterfaces; using ......

Posted On Tuesday, June 27, 2006 4:27 PM

More on DTOs, notification for presentation, and flogging dead horses
I am flogging the dead horse about Data Transfer Objects (DTO's), also called Value Objects, and their usefulness, picking up on what I discussed in my last post. Using NHibernate on my current project, the topic of DTO's and their validity was incited by the Hibernate In Action position that DTO's are suspect in regard to their compliance to OOP. Fowler (he has to be mentioned, right?) himself calls them beasts and focuses on their usefulness for clients utilizing the domain objects across a remote ......

Posted On Monday, June 26, 2006 8:26 PM

DTO's, Service Layers, Code-behinds, and patterns
Ah...so continuing my search for the perfect architecture (joke) my current issue was the usefulness of Data Transfer Objects (DTOs) at my last post. I am still dumfounded when I find what might be considered "high-ranking" Microsoft folks admit to either ignoring or knwoing little about design patterns. I know design patterns are just a means to an end of good software delivered timely and fit for scalability, but it seems like they should at least be in the toolbox...but I digress. My current confusion ......

Posted On Tuesday, June 13, 2006 7:59 AM

Presentation to Service Layer - to DTO or not in ASP.NET?
So a simple design question to get feedback about what folks think regarding ASP.NET usage of a Service Layer. In an application (non-distributed web app) that wants to implement a Service Layer to provide a simple API for a relatively complex business logic layer, there seem to be two options for communicating data from those clients...in our case a web page. In the code-behind, we can grab the values from webcontrols and send those primitive types directly to the service layer methods - our basic ......

Posted On Monday, June 12, 2006 10:02 PM

O/R Mappers and the Lone Ranger
I work alone (unfortunately) for a mid-size firm and am involved in aggregating very diverse types of data to eliminate data silos such as accounting packages, miscellaneous access dbs and excel workbooks, and payroll packages. On top of that I am building a package to handle construction material's testing procedures/calculations. Being all alone forces me into being very interested in things that make my life easier. Most tools that I find in development are great, but the overhead associated with ......

Posted On Sunday, June 11, 2006 9:57 PM

NHibernate Gotchas - Many-to-many duplicate records
This isn't exactly a "gotcha" since it just has to do with writing mappings correctly and thoughfully. But if you are like me, you use CodeSnippets in VisualStudio 2005 to create all your mappings...the carpal tunnel looming upon me after hand coding a million mapping files (zzzz) forced me into working smarter with Snippets. Anyways, here was my situation. Minor, but took about 15 minutes to debug. Say two classes, class A and Class B, require a many-to-many relationship with each other. Within ......

Posted On Thursday, June 8, 2006 8:42 AM

Copyright © Mike Nichols | Powered by: GeeksWithBlogs.net