Looking for OpenAPI experts available for 2 quick consulting projects Follow
Everyone,
The Open APi is an amazing concept - however, in the absense of
documentation and good examples, I just don't have the time to figure it out
like I should. However - quite a number of you seem to have.
I want to create to quick refactorings. The first is simple - Create
Repository. Given a class like:
public class Individual : DomainObject
{
private string _name;
...
}
it should generate, IN THE APPROPRIATE SubDIRECTORY (this is actually
important), the following:
public class IndividualRepository : DomainObjectRepository <![CDATA[
{
}
I dunno - this is so simple, it might even be possible to do without an
OpenAPI - they key though is that it needs to be smart enough to insert
itself into the right place in the directory structure. So if Individual is
in DomainObjects/CRM/Individual, the repository class needs to be in
DomainServices/Persistence/CRM directory.
The second refactoring I need is Create Data Transfer Object. So, take the
following class:
public class User : DomainObject
{
///Comments
private Association _associatoin;
///Comments
public CommandShortcut _commandShortcut;
private string _name;
private IList _permissions;
private IList _lastLogins;
private IDictionary]]> _preferredName;
... and then the matching public properties
}
From this class, the refactoring would create another class - dtoUser. See,
this class is reponsible for sending data over the wire - so it needs to be
XML seriealizable. Well - .NET can't XML serialize interfaces, so first
thing is,we need to convert all interfaces to concreate classes. Next is we
have several domain objects embedded in this one - we need to either
converted them to their Data Transfer Object equivalents, or use a Guid
field (every DomainObject has a Guid). The popup box should give me the
option to specify what I want to do. So, assuming I tell the plugin to
convert to the DTO equivalent for every property BUT Association, the
resultant class should look like:
public class dtoUser : DataTransferObject
{
///Comments
private string associationGuid;
///Comments
private dtoCommandShortcut _commandShortcut;
private string _name;
private List<![CDATA[ _permissions;
private List _lastLogins;
private Dictionary]]> _preferredName
.. and then the matching public properties
}
Note that the resultant class needs to be automatically put in the right
directory structure, which is actually in another porject in the same
solution. Also - the DTO class contains all of the members and properties,
but NONE of the methods of the domain object - and they are grouped together
in #region directives.
I assume some kind of XML config doc that I could edit would provide the
mapping between interfaces and concrete classes - IList to List for example.
We only use 3 or 4, so this shouldn't be a problem.
OK - this is the scope - anyone game to help me out fo ra few days on a
contractor basis?
Thanks,
Andrew
Please sign in to leave a comment.