Print Page | Close Window

Feature Requests

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1669
Printed Date: 11-Apr-2026 at 3:34pm


Topic: Feature Requests
Posted By: DavidKozikowski
Subject: Feature Requests
Date Posted: 03-Mar-2010 at 7:38am

First I would like to say great product.

As I work with the tool there are things I would like to see to make our life even simpler.

I’m wondering if IdeaBlade should start a Feature Request Form.

Here is one feature that should be a relatively easy addition that would make our life’s simpler.

In the DevForce EF Object Mapper I would like you to extend the code generator option under the “Create developer classes” to include “Include stub Create Methods”.  It would generate stub code below. I would say that 99% of the objects will need to “add” and at minimum this is the code required to do it.

    public static Customer Create(EntityManager entityManager) {

      Customer aCustomer = entityManager.CreateEntity<Customer>();

      aCustomer.EntityAspect.AddToManager();

      return aCustomer;

}

 

 

If you wanted to take it furher you could add something that would ask for the “other” items you would want in the constructor say Include Key creation, initilaze String to something etc. like from the sample of your sample app.

 

public partial class Customer {

    public static Customer Create(EntityManager entityManager, string companyName) {

      Customer aCustomer = entityManager.CreateEntity<Customer>();

      // Customer key is a single property, guid-valued

      DataEntityProperty key = aCustomer.EntityAspect.EntityMetadata.KeyProperties[0];

      aCustomer.SetRawValue(key, System.Guid.NewGuid());

      aCustomer.CompanyName = companyName;

      aCustomer.EntityAspect.AddToManager();

      return aCustomer;

    }

That way every time I wanted to add a new record I would know to call create on it as in.

Customer newCustomer = Customer.Create(_entityManager);

This would be great thanks.




Replies:
Posted By: WardBell
Date Posted: 21-Apr-2010 at 1:32pm
Hi David - Glad you are enjoying the product. Sorry for getting to this so late.
 
We've thought hard about this request over the years ... and decided that it is imprudent architecturally.
 
Some entities shouldn't be created at all. Some should only be created only by the parent object. Others need special creation logic. 
 
We think the developer should make a conscious decision about which entites can be created, how, when, by whom. Frankly I'm not happy that we offer a public Delete method either ... because, again, the developer should make a conscious decision.
 
Reasonable people will disagree about what should and what should not be generated. We drew the line here.
 
THAT SAID, YOU CAN DECIDE OTHERWISE IN DEVFORCE 2010!
 
In DF 2010, you can make your own decisions about what to generate into your entities by customizing the DevForce T4-based code generation behavior.
 
It's pretty easy. If you disagree with us and want Creation logic inscribed in your classes, ... have at it.
 
Happy coding!



Print Page | Close Window