Best prac for Q1 2010

29 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 Mar 2010 Link to this post

    Seems like with 2010 and the new model designer I'm finding myself starting from scratch again with how to use this....can we get a blog post on what to do?  Not as far as linq and queries, but the new methods\ways of mapping...

    For example
    1) When I rename an item in the model designer, and rebuild, why is the old .generated class still there
    2) How do we extend these classes (like before where we could just create a new method\property)
    3) Do we need the old reverse mappings anymore?
    4) What do we do to old OA projects....delete all classes and create a new model?...if so refer to #2
    5) How do we add entities we forgot to add on the inital mapping if it crashes every time...can there be a internal build sometime real soon?...like tomorrow :)
    6) Blog series starting tomorrow? :)

    Steve
  2. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 11 Mar 2010 Link to this post

    I would like the same...

    All I know is that I added a Domain Model to my current Forward Mapping project and it so far has royally screwed it.


  3. DevCraft banner
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 Mar 2010 Link to this post

    Yeah, I've been sidelined from my project since I installed, added the map...my project is royally boned right now

    Like I dont know what this is telling me to do...the DAL (now) just has an App.Config with a configuration-connectionstring node structure...that it generated.  An OA Enabling the web project again it doesn't seem to see the DAL to give me the connections in the wizard *sigh*


    The assembly 'DAL' does not have a config file with an openaccess node.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Telerik.OpenAccess.Exceptions.ConfigurationException: The assembly 'DAL' does not have a config file with an openaccess node.

    Source Error:

    Line 89: 
    Line 90: if( theObjectScopeProvider1.myDatabase == null )
    Line 91: theObjectScopeProvider1.myDatabase = Telerik.OpenAccess.Database.Get("EntityDiagrams");
    Line 92:
    Line 93: return theObjectScopeProvider1.myDatabase;


    *EDIT*
    Deleted it all again and regenerated...now it's not even giving me connectionstring nodes...just
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    </configuration>
  5. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 11 Mar 2010 Link to this post

    After adding a EntityDiagram my App.Config file got fried, I noticed OpenAccess pretty much started ignoring it and would not make a single change to it.

    I think I can answer your #2 question...  Since the generated classes are partial classes, you can just add another partial class to extend it.

    pubilc partial MyClass
    {
    public string MyExtendedProperty
    {
    get; set;
    }
    }
  6. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 Mar 2010 Link to this post

    Yeah, I guess...is that what we're supposed to do though?...

    Whats all this MetaClass MetaProperty stuff about.  If this is a replacement for reverse mapping I don't understand what adding meta anything to my classes does....doesn't that break the map?  Technically it doesn't matter since I cant add one anyway, or even another entity because it throws an object reference error.  I put a ticket in and they said it's a known issue and will be fixed in a service release (which really doesn't help me at all right now).

    I found Meta info in the CHMs, and it's quite detailed if you understand the concepts, but I cant find the part where it outlines what a MetaClass\etc is (I know what meta data is, but not in a reverse mapping context).  If you read it, it just seems like Meta is appended to every second word. 

    So while the new linq goodies are awesome, this metadesigner is metamaking me want to metauninstall it.

    *EDIT* I re-read the ticket, the issue fixed in the service release is the openaccessdatasource control wasn't tested with this model type, so it just doesn't work, we need to continue to use the old method.  Which honestly bones me because I scrapped the old method based on another ticket which told me to...

    Telerik: I understand you were under probably huge pressure to get this out for release with every other product.  But if you had given us at least a beta like the other products did we might have been able to find these issues in advance.  This type of thing just pisses off the early adopters who've been told for months on these support forums how Q12010 was the be all,end all,fix all for OpenAccess.


  7. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 12 Mar 2010 Link to this post

    Hello Guys,
    Today we will be uploading a new build with all the known defects fixed (I will notify you in this thread). Also I will be putting a blog how one should use the new designer in mixed environments (with mapping done by a previous version). Until that happens here are few suggestions about what needs to be done and how:

    1. Problem: Designer templates are not showing in the "Add New Item" dialog.
    Currently we install in LocaleID folder 1033, so only VS with US-English settings is able to pickup the template.

    Resolution: That is fixed and will be uploaded today. In the meanwhile yo can go to the templates folder: (C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Data\1033), find the EntityDiagrams.zip, and move it one folder up (outside the LocaleID folder). That should fix the issue (You will probably have to run devenv / installvstemplates from the command line if they are not registered properly).

    2. Problem: I am having problems with references in my projects.
    We separated the Win and Web UI into separate assemblies out of Telerik.OpenAccess - so you will end up with more assemblies (that may be the reason for datasources in win and web to stop working).
    Solution: Please run the CheckSettings wizard, available under the Telerik>OpenAccess>Configuration.

    3. Can I use the new designer with mappings and code, in a single project, produce by previous versions of OpenAccess?

    No, this is not recommended because of the following reasons:

    1. ProjectEnable, Schema and Ehancer tools. They are changed for the new designer to operate, but have in parallel version used by the older projects. You cannot mix them together because the result would be probably that the new enhancer will try to enhance the older project and will fail to detect the persistent classes.

    Best practice: If the project is enhanced with previous version of OpenAccess, please do not add the new designer files to this project.
    Solution: If after removing the designer files problem still occurs, try to unload the project, open it in XML editor, scroll to the bottom and remove the following line (or similar):
    <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />

    - Save, reload and the problems should be solved (that way we are removing the new enhancer from the build sequence).


    4. Is the new designer substitute for the Reverse-Mapping wizard?

    At the moment: YES and NO both because of the following reasons:

    - the upgrade tool for translating older versions projects to the new designer is still no ready, so you cannot switch easily to the new functionality

    - Because we are using different infrastructure (enhancer, automation, etc.) one should not mix both together in the same project (compilation and build problems, unexpected behaviors in runtime)

    - We suggest using the new designer in new projects, not for upgrading projects done with previous versions. Currently the scope of the designer is for small to medium size projects (When we release a full-fledged round-tripping designer later this year, we will cover all scenarios).

    - The new designer should not be added to a project that contains forward mapping as well (for that matter should not be added to a project 'enabled' by a previous version of OpenAccess, because this exactly sets the used infrastructure).

    5. Why are my datasources not working anymore?

    If all went well (pgrade via CheckSettings dialog, etc.) The datasources should be usable in projects that are developed with previous versions of OpneAccess. Currently we don't have a datasource compatible with the new designer - we are still working on it (will be available for the first SP or even earlier).

    P.S. I will try to add all Q&A s in this thread, and later one we will put a blog/KB out of it.




    All the best,
    Dimitar Kapitanov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 12 Mar 2010 Link to this post

    Hi Guys,

    Here is another approach towards using the new designer in a scenario like the one Steve initially reported:
    After generating the classes with the new designer, you see an exception saying that no OpenAccess node can be found in the app.config file. Here are the steps for continuing with the new designer generated classes:
    1. Delete all classes that were generated by the old reverse mapping wizard.
    2. Delete the 'openaccess' section from the app.config file
    3. The next step is to change the method that you use for obtaining the object scope in your application. Here is an example of a classical GetScope() method used in users application:
    public static IObjectScope GetScope()
    {
        Database db = Database.Get("DatabaseConnection1");
        return db.GetObjectScope();
    }

    If your new .rlinq file is called "EntityDiagrams1", this is how your new GetScope() method should look like:
    public static IObjectScope GetScope()
    {
        XmlMetadataSource metadataSource = XmlMetadataSource.FromAssemblyResource("EntityDiagrams1.rlinq");
        MetadataContainer container = metadataSource.GetModel();
        BackendConfiguration configuration = new BackendConfiguration();
        Database db = Database.Get("DatabaseConnection1", configuration, container);
        return db.GetObjectScope();
    }

    If you are using Attributes mapping in your new designer model, you should change the first line to:
    AttributesMetadataSource metadataSource = AttributesMetadataSource.FromContext(typeof(NorthwindEntityDiagrams));
     ...where NorthwindEntityDiagrams is the name of your new generated context class.

    The reason behind this procedure is that the API for the Database.Get() method has been changed for the purpose of using the new metadata produced by the visual designer.
    All the best,
    Zoran
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 12 Mar 2010 Link to this post

    I had a compiling version of my dll with an rlinq, but when I deleted my objectscopeprovider and re-generated that, it generated the old methods still (made sure I built my DLL and the web project had the latest version)

    public static IObjectScope GetScope()
    {
        Database db = Database.Get("DatabaseConnection1");
        return db.GetObjectScope();
    }



  10. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 12 Mar 2010 Link to this post

    Hi Steve,

    You should not use the ObjectScopeProvider class with the new OpenAccess designer code generation. The reason for that is that the new version is intended to work with the new Context that is generated alongside the entity classes. Nevertheless we are aware that there are customers projects that work with the old API so for those projects you will have to writhe your own provider class that contains only the code that I have written in the previous post. Automatic generation of the provider class contins code from the older versions so you should not use that class with the new Q1 version. We will automize that process of migration in the next maintenance release where the user will have the option to generate ObjectScopeProvider class which will internally work with the new API and will correctly return IObjectScope instances.

    Regards,
    Zoran
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  11. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 12 Mar 2010 Link to this post

    Ok, I'm extra confused now :)

    I'm just going to stick to the old way of doing things until there's practical documentation on how this all works
  12. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 12 Mar 2010 Link to this post

    Thank You Telerik for the updates.

    I think I am just going to stick with the Old way as well... It just works!

    Seems like you guys are trying to deliver an unfinished product.  Would have been nice to have some of this information in the DOCUMENTATION!



  13. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 12 Mar 2010 Link to this post

    Hello Brian,
    We definitely have information regarding the use of designer inside our documentation - unfortunately what seems to be missing is a guideline for the upgrade procedure. We consider the fault i s ours - we believed that the designer will be mainly used for new projects, not upgrade of existing. I would like to apologize on behalf of the team, and point out that we will roll out a new build with everything fixed later today.

    All the best,
    Dimitar Kapitanov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  14. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 12 Mar 2010 Link to this post

    The webinar going on right now (not even over yet) clears up a LOT of confusion :)

    It's starting to make sense now...
  15. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 12 Mar 2010 Link to this post

    Webinar did help alot.

    I didnt see anything in the documentation that told me not to add it to existing projects, or how to undo that mistake.
    It also didnt list the VS compatibility.
    I also had to figure out for myself that you dropped .Query and created .Web / .Win

    They were all pretty minor things that we just didn't know about and had to discover on our own.  I guess a pitfall of trying to adapt to newly released software.

    I'm sure you guys will improve everything beyond our expectations.  At least thats the way its been in the past ;) 


  16. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 12 Mar 2010 Link to this post

    Well it helped me understand the concepts

    They've told me in a ticket they're adding a dialog or something to warn or prevent adding it to existing projects.  However looks like they never met the "Will be fixed in a build today" deadline
  17. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 14 Mar 2010 Link to this post

    Hi Steve,

    The new build is uploaded, you should be able to download it from your account.

    Kind regards,
    Alexander
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  18. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 14 Mar 2010 Link to this post

    Hey, thanks...

    I dont see a new version up, or did it just replace the existing version (date is still the 9th)
  19. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 14 Mar 2010 Link to this post

    Looks like the file is there.  The dates posted are incorrect.

    I am downloading now.  Just hope its the correct binaries included this time. ;)  


  20. Sörnt Poppe
    Sörnt Poppe avatar
    46 posts
    Member since:
    Mar 2010

    Posted 14 Mar 2010 Link to this post

    They fixed my issue "not seeing the Telerik OpenAccess Domain Model" item template.

    Thank you for that.
  21. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 14 Mar 2010 Link to this post

    This one seems much better :D

    Thanks for all the hard work
  22. Mike
    Mike avatar
    7 posts
    Member since:
    Jun 2007

    Posted 06 May 2010 Link to this post

    Dimitar,

    I'm having trouble putting some flesh on this statement :
    'We definitely have information regarding the use of designer inside our documentation '
    There is a section called 'Using Open Access Model Tools' in the Help file, but it exists in a vacuum.  There's nothing there to tell you what you do with the thing it generates.  Even the absolute basic 'Quickstart - your first Application' says nothing about the Visual Designer. 

    The 'Made Easy' PDF never heard of it either.

    People on this forum seem to have found the Webinar useful - I thought it was recorded and available as a download but I can't find it.

    Is the Visual Data Designed premature?  Whats your advise- should I forget it and check back next year?

    Michael
  23. Brian Shackelford
    Brian Shackelford avatar
    7 posts
    Member since:
    May 2008

    Posted 06 May 2010 Link to this post

    I think the video you are looking for is here:
    http://tv.telerik.com/whats-new/video/whats-new-openaccess-orm-justcode-q1-2010

    Most of the concepts in the Made Easy Guide and Online Documenation still apply.  The biggest challenge is getting the Visual Designer to work in 2010 which I believe they are now testing deployment methods (I think this is the last I read in the forums).  I believe that updated documentation is on its way as well, although digging around and working with the product is always the best way to learn.

    if you have a specific question or are having problems, their support is Top Notch and most of the folks here in the forum I have found to be very helpful (although this is one of only a few times I have posted here).

    If you need some specific help - post the problem and I am sure folks will be happy to lend a hand figuring things out.

    - Brian

  24. Mike
    Mike avatar
    7 posts
    Member since:
    Jun 2007

    Posted 18 May 2010 Link to this post

    Thanks Brian, the webinar got me interested at least, which is its purpose, so I'm digging around.  The lack of common sence in the little documentation this team has produced is mind boggling.  For example I'm trying to understand the visual representations of Associations at the moment.  Here's what I've got to work with in the chm files :

    Defining A Data Model->How To:Create and Delete Associations  shows a screen image which illustrates an association between Products and Categories , however it was taken with the 'properties' collapsed so you can't see how it is reflected in the individual properties.  Looking further down into the instructions for creating an association shows a convoluted dialog box hoping I'll understand a relationship between Categories.CategoryID and Suppliers.SupplierID. 

    Recognising that its as clear as mud I can then click on the 'Mapping Details Editor' link in search of inspiration and yippee! it illustrates the details of a relationship between the Products and Suppliers table.

    I'm losing it for sure.  I started this voyage having being intrigued by the statement that
    'Associations can only have two participating types, and each participating type in the association is known as an End (Source and Target)'  and then finding myself looking at three ends ; Source , Target and Owner!. 

    I actually understood this stuff in the Reverse Mapping Wizard!!

    Mike
     
  25. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 19 May 2010 Link to this post

    Hi Mike,
    Thanks for the feedback. We will investigate what you just pointed out and will improve the documentation. Next release will be in a couple of days.

    Sincerely yours,
    Dimitar Kapitanov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  26. xu
    xu avatar
    11 posts
    Member since:
    Oct 2008

    Posted 21 May 2010 Link to this post


  27. Kurt
    Kurt avatar
    17 posts
    Member since:
    Aug 2006

    Posted 08 Jul 2010 Link to this post

    I have to agree with some of the issues presented in this thread. However, even starting from scratch using the 2010 version of OA is somewhat confusing. It seems that if I create a new domain model (.rlinq) that  the need for the ObjectScopeProvider has become OBE, or the implementation needs to be changed. Based on a comment in the what’s new video for Q1 2010, it would seem that the new Entity Domain Model needs to be managed in a manner similar to how the scope was managed in previous versions, e.g. only one per application or web request instance? Again, this is a lot of inference, as all of the examples in the http://www.telerik.com/documents/OpenAccess-MadeEasy.pdf document are based around the object scope provider..? So, now I am also confused.

    For Example:

    static public class ModelFactory
        {
             
            static OpenAccessContext myModelContextObject;
     
            public static T GetModel<T>() where T : OpenAccessContext, new()
            {
                if (myModelContextObject == null)
                {
                    myModelContextObject = new T();
                }
     
                return myModelContextObject as T;
            }
     
            public static T GetModel<T>(HttpContext context) where T : OpenAccessContext, new()
            {
                string key = HttpContext.Current.GetHashCode().ToString("x") + Thread.CurrentContext.ContextID.ToString();
                T model = context.Items[key] as T;
                if (model == null)
                {
                    model = new T();
                    context.Items[key] = model;
                }
     
                return model;
            }
    }



    Likewise, I am unsure of how to proceed if I would like to take advantage of the disconnected features, eg the Object Container.  From a few examples I have seen, it seems that there is a way to create the scope provider using a domain model, however, is this a “Best Practice”.



  28. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 13 Jul 2010 Link to this post

    Hello Kurt,

     You are right, the OpenAccess Made Easy guide is not updated after the new API of OpenAccess was introduced. However we have updated the official product documentation which contains all of the required information for a developer to successfully use OpenAccess and its Visual Designer. I suggest you getting your knowledge of our features based on the help that is being shipped with the product(it will soon be available as our official web help as well). I am sorry for any inconveniences this might have caused you.

    Regards,
    Zoran
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  29. Rahman
    Rahman avatar
    1 posts
    Member since:
    Jul 2012

    Posted 10 Oct 2010 Link to this post

    Hi there,

    I am using "NTierExampleBR' project in one of my upcoming development project.
    I noticed that the new OpenAccessContext doesn't seems to have similar "CopyTo" and "CopyFrom" methods.
    Can you please point me to the right documentation or example code that I can follow.

    Thanks
    Rahman.
  30. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 14 Oct 2010 Link to this post

    Hi Rahman,

     Can you please be more specific about the example that you are using as we do not have an example with that name - "NTierExampleBR". However since you mentioned the CopyFrom and CopyTo methods, it seems that you have been looking in an example that has been build upon the ObjectContainer API. There is no equivalent of the ObjectContainer in the new OpenAccess API and the Domain Model approach that was brought up with Q1 2010. If that is the way you would like to go with your application, you should use the old API and the Reverse Mapping Wizard.

    All the best,
    Zoran
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner