Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...User registration logic refactoring requestUser registration logic refactoring request
Previous
 
Next
New Post
4/22/2007 12:00 AM
 
 
First a little background. I'm an experienced software engineer and think himself have some clues on software development and software design. Hope you still agree on this after your reading. Also I've been working full time on a DNN product for 6 months and I'm a happy user. So please don't take this thread as an offence.
 
 
Currently DNN core organizes its most business logic in controller classes, which consist of static methods. Info classes are used as dummy classes to pass information around. IMHO, this is not more procedural way than OOP . A software class should have both behavior and information and they shouldn't be separated, just like us human beings. For example, in an accounting department, there are account assistant, account receivable (AR), account payable (AP) and department manager. Everyone has his own professional knowledge and instructions or rules to follow (information) and do things differently (Behavior). an AP position is different from an AR position not only because they do things differently, but also because they require different professional knowledge, different accounting rules and different input from outside, or we can say In essence AP and AR are different because they do things differently, requires different accounting knowledge, follow different accounting rules. Information and behavior are equally to important and are two inherent parts of two accounting job.   There is no point to separate these two and no way to separate them if we want accounting things work.  
 
 
Separation of information and behaviors in software classes cause problems too. When we try to extend a class, we have to extend both info and a controller class, which is a real pain when you have to deal with complex domain model that usually has a lot of inheritances. As a result, the number of classes increase a lot and you have to pass info classes around to do the simplest things, which in true cause more headache.
 
 
When it comes to business logic, there are at least two types of them (forgot when and where I learnt the idea, but it works for me). Some business logic belongs to a single class, and some business logic is related to specific business process or part of it. The latter should be in business process classes not controller classes. Usually business process classes delegate its responsibility to other domain classes and coordinate between them to get job done. Thus, business process classes are perfect candidates for transaction control. Putting different concerns into a business class is to ask for trouble. The result is business classes are unnecessarily coupled to other classes and hard to understand, maintain and improve. Sometimes the process logic goes to code behind file when developers find it belongs to nowhere. IMHO, DNN core architecture misses another layer above current business layer- I call it business process layer, which is a facade of business layer and deals with business process. This way we can organize business logic in more understandable and reusable way. One example is in CreateUser method of a UserController class and UserCreateCompleted in manageusers.ascx.vb, user registration logic can be improved easily if there is another abstraction on top of current business layer. Module developers can then call the method in business process class and reuse logic in both UserController class and code behind file.
 
 
That's all for today. Thanks for reading and I will write more when I got time.
 
Frank
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...User registration logic refactoring requestUser registration logic refactoring request


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out