They are like base types in the sense:
- They are structured values; not objects with identity
- They can be used for entity members or DomainService method parameters
- There is no inheritance or association (inbound or outbound) support
- They are code-gen'ed
- They are deeply change tracked, validated (with error reporting) when used in an entity
Samples of intended use:
Customer.Address where address does not have an identity of its own
Shape.Coordinate where coordinate is used like a value (no associations etc)
Samples of unintended use:
In place of composition -
Order.OrderDetail // OrderDetail if captured in a separate relational entity likely has its own ID and associations
For many-to-many link entity/table
Course.Registration or Student.Registration // another entity with its ID
In this round, we didn't really get a chance to provide a mechanism to use a complex types like a base-type - with essentially a portable assembly across Silverlight and .NET. That was a scoping decision based on priority feedback from a few MVPs we regularly talk to.
For more about the feature use and all the bells and whistles see Mathew's detailed blog post.
What is your scenario for complex types? Do the beta bits releases at PDC work well for your scenarios?
Thanks.
Dinesh
My plan is this:
ReplyDeleteI have a standard DomainService for my regular Entity stuff. But I also created an DomainService for some non-database driven service calls. This should allow me to abstract out my service calls and keep things nice and neat.
My serivce calls will return complex objects that I can use directly in my client.
Well, that's the hope anyway. I am still not able to get it working just yet. I just got the SP1 installed, but I am having trouble using complex objects from other assemblies.
Thanks for the post...
-Scott
Hi,
ReplyDeletemy complex type is like below:
Custom
{
string name,
string desc,
Entity entity
}
and I want to return it to the client, but I wasn't able to
Thanks,
Aran
very useful information for us.
ReplyDeletebest cafe in chennai