New Posts New Posts RSS Feed: Feature Requests
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Feature Requests

 Post Reply Post Reply
Author
DavidKozikowski View Drop Down
Groupie
Groupie
Avatar

Joined: 02-Feb-2010
Location: Aurora, IN
Posts: 59
Post Options Post Options   Quote DavidKozikowski Quote  Post ReplyReply Direct Link To This Post Topic: Feature Requests
    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.

Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down