This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Convention over Configuration is great. However, in the long run we see that the database might have other column and table names than the corresponding Domain model field and class names. At least temporarily so due to a heavy load conditions. So is there a way to do this configuration in Lightspeed today? |
|
|
Yes. There are several options: 1) For database wide naming standards e.g. tbl_Foo we let you implement INamingStrategy which allows you to intercept name resolution. 2) In 1.2 we have provided Table and Column attributes which allow for fine grained naming control at the class and field level. 3) Another approach we've used internally is updateable views Cheers, Andrew. |
|
|
You can experiment with the TableAttribute and ColumnAttribute in the latest nightly build of LightSpeed which includes many of the 1.2 features. http://www.mindscape.co.nz/Products/LightSpeed/nightlybuilds.aspx Hope that helps, John-Daniel |
|
|
ok, Since we don´t have the need at this moment we can probably wait for the number 2 option. However, perhaps number 1 might be a better solution since we don´t want to clutter our domain model with database specific knowledge? Any chance you can give a documented example of how this works in your manual? No rush, but it would be nice.
|
|
|
Number 2 is particular useful for wide-ranging naming schemes. A good example is if you wanted every table to start with "tbl_" you could do this: public class CustomNamingStrategy : INamingStrategy Then simply set this implementation in config or on LightSpeedContext like so: <LightSpeed namingStrategyClass="MyNamespace.CustomNamingStrategy, MyAssembly"/> Cheers, Andrew. |
|