request: support for nested types

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

request: support for nested types

Post by mindplay » Wed 21 Dec 2011 18:39

I'm working on a project with a high degree of polymorphism, in which a number of types are nested within another type, forming a type-hierarchy - mostly for semantic reasons, but unfortunately means I have to do a lot of refactoring and cleanup to migrate this project to ED.

It would be useful to have support for nested types.

In terms of UI, I would recommend simply allowing the use of "." in class-names. (alternatively, you could add a ParentClassName property to classes, but that would probably complicate code generation, as you would need to check for this property when generating filenames, and when referencing the type from a navigation-property.)

In terms of code-generation, nested types are allowed to reside in separate files, in multiple partial classes - so that should be fairly straight-forward to do. For example, for a nested type Foo.Bar:

Code: Select all

    public partial class Foo
    {
        public partial class Bar
        {
            // ...
        }
    }
In other words, it's just an extra class-declaration surrounding the inner class-declaration when generating a nested type...

(EDIT: not quite true - you would have to look at the parent type to discover if the parent type was defined as abstract, and take that into account.)

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 23 Dec 2011 11:49

Thank you for your suggestion but there is no timeframe for this feature implementation.

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Thu 26 Jan 2012 19:56

For the record, I am no longer interested in this feature - I am refactoring existing code, using namespaces instead of nested class-names, which seems to work better for various reasons.

Related to this, I have posted a description of another issue: the lacking or buggy support for namespaces...

Post Reply