design

How to reach CSS zen ?

CSS looks like a set of tricks to me. Whenever I read about some css technique, it looks much more like tricks that techniques. When I write CSS, I often need to adapt the html structure and I feel bad. Did some of you had some enlightenment and enjoy CSS zen ? How did you reach CSS zen ? ...

How do I modernize this process?

I'm looking to modernize our somewhat archaic process of receiving forms and entering them into our system. I've managed to convert our tracking system (where the forms are entered) to c# .net from classic ASP, so any solution should be based on something I could do using .net so I can integrate the two. First, I'll lay out the current ...

Java Code Design Question and Example

Hey everyone, I've been writing code in Java for awhile now, however I feel as though I lack in code "design" - that is, creating packages and separating classes and such. I'm just not sure when to create what. So, I'm practicing :) I am setting out to write a Calculator (with a Swing GUI), and I want to create a really good design for...

How to split a data layer and business object layer, what are the appropriate duties of each?

If there was a line of business application layered like this, would this be an appropriate division of labor : Data Access Invokes only stored procedures, maps properties of DTOs to a hash tablse which are used to populate ADO.NET command's parameter collections. Only assembly with reference to SqlDataClient. Significant logic dealin...

General Quesion Regarding File Downloads using Drupal

Dear Stack overflow, I would like to know the best way of going about getting Drupal to provide a site with the following functionality: UPLOADS 1. User Uploads a File (jpg, .cr2) through a simple file field form 2. If user is not anonymous they need control to specifiy if file is available for public, private or for a group of buddy'...

Why is there not a `fieldof` or `methodof` operator in C#?

They could be used as follows: FieldInfo field = fieldof(string.Empty); MethodInfo method1 = methodof(int.ToString); MethodInfo method2 = methodof(int.ToString(IFormatProvider)); fieldof could be compiled to IL as: ldtoken <field> call FieldInfo.GetFieldFromHandle methodof could be compiled to IL as: ldtoken <method> call MethodBa...

Confused about Single Responsibility Principle in the following example

In the following video, the author takes an existing class and assigns the Single Responsibility Principle to it. He takes a Print Class that has the job of Accessing Data, Formatting, and Printing the report. He breaks up each method to its own class, so he creates a DataAccess class to handle data access, he creates a ReportFormatter...

Why do `Assembly` and `Module` have no publicly defined constructors?

I'm building a .NET assembly loader in C# for an "experiment"/learning more about .NET internal operations. I've implemented the reflection API by deriving types like: RuntimeType : Type RuntimeFieldInfo : FieldInfo RuntimeMethodInfo : MethodInfo RuntimeParameterInfo : ParameterInfo RuntimeConstructorInfo : ConstructorInfo RuntimePrope...

How to implement objects of same class with different behaviour

Lets say Michael Jackson and I are objects of same class HumanBeing. But he had a better implementation of the behaviour 'dance' than me . How do I do this programatically , so that 2 objects of same class can have different implementation? class HumanBeing { public : HumanBeing(){}; void dance() { } }; HumanBeing Me , MJ; ...

modelling and responsibility

Let's say that you want to create a model of a bank account in your application. You could create a class BankAccount that does what a typical bank account does. But if you're asked what the responsability of the class is, what's the answer? 'Behaving like a bank account?' That's not very concrete. I'm a bit confused on the relationship ...

data access: exception to 'Tell, don't ask'?

Are data access objects an exception to the rule 'Tell, don't ask'? Eg get last 10 posts from a table data gateway? ...

WinForm fat client: Architecture decisions: Did I make the wrong ones?

I have a .NET Winform Click-Once-deployed fat client that talks to three databases, 2 SQL Server databases and a Oracle one. The first SQL Server database, I will call the Master. I wanted add more tables and columns to the Master database but I was told I would not be given rights to do so, that it was non negotiable. So, I decided to ...

using MVC MVP patterns in winforms

I have read online about MVC, MVP patterns for UI design. But, I can't quite grasp how the it works even after re-reading it couple of times. I use C#/winforms for development. Can someone point me to a good book/blog/website? Something that will make me decide if I should adopt it or not. Thanks. ...

Talk to data warehouse-style tables with ActiveRecord?

As my Rails app matures, it's becoming increasingly apparent that it has a strong data warehouse flavour, lacking only a facts table to make everything explicit. On top of that, I just read Chapters 2 (Designing Beautiful APIs) and 3 (Mastering the Dynamic Toolkit) of Ruby Best Practices. Now I'm trying to figure out how best to design...

c# design question - standalone GUI application

Hi folks. It's a pleasure to see how much knowledge people have on here, it's a treasure of a place. I've seen myself writing code for DataGridView events - and using DataSource to a backend prepared DataTable object. Sometimes the user can remove rows, update them etc. and the underlying data will need validation checks again. Let's a...

Software design problem: circular dependency

hi, i've stuck at a little design problem. following situation Library Interface Contains interface for every model class (getters and setters only) Libray Businnes Logic Contains implementations of interface library and DAL. Uses interface & transporter library Library Transporter: Contains classes for messaging 3rd party web ser...

difference between strategy pattern and delegation pattern

What is the difference between strategy pattern and delegation pattern (not delegates)? ...

Examples of context menus that don't require a right click

I am looking for examples of menus or toolbars that are shown without having to perform a right click. One example is the mini toolbar in Office 2007 which is shown automatically when selecting text. Are there any other examples out there of menus which are shown on a single click? I am looking for an elegant way to provide formatti...

How to design a class?

I want to I can improve myself, and then I can design a class as a masterpiece. But I don't how to do that, and what rules I should follow? any suggestions? Thanks in advance ! ...

Create css files compatible with multiple browsers automatically

Is there any solution that allows you to design a webpage (with, say, a wysiwyg editor) and then automatically compile the design as one or several css file(s) compatible across multiple browsers? ...