db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Build Apps on top of db4o (.NET)

Last post 03-25-2006, 12:21 AM by Eric Falsken. 1 replies.
Sort Posts: Previous Next
  •  03-22-2006, 09:20 AM 23506

    Build Apps on top of db4o (.NET)

    I've been working with db4o for a while now and find it reliable and amazingly simple.

    Now I'm beginning to think how to use/create a code generator for query/UI part of the application.

    With db4o the starting point would be the class definition.

    From the fields/properties of class (with reflection, I was thinking that reflector could be a very good starting point) the generator must be able to code appropriate methods (it should also infer the kind of relation with other classes)

    Then another interesting thing would be to define a best practice for standard Windows Forms and ASP.NET class managment (this meaning List, Add, Update and Delete class objects and connected objects)

    Is anyone interested in defining a sort of methods and ASP.NET/Windows Forms "best practices"?

    Is there any suggestion from Carl and Eric about these topics?

    Tommaso


    Conoscerete la Verità e la Verità vi farà liberi.
  •  03-25-2006, 12:21 AM 23579 in reply to 23506

    Re: Build Apps on top of db4o (.NET)

    I guess the first question would be: Using db4o is so simple, Why use a code generator? (beyond the class model itself)

    A code generator that works out methods from the relationship of classes would be tricky to get right. Personally, I am against tools going to such lengths. The trouble to create a tool that is flexible enough to be useful ... there are so many types of relationships.

    As for a "Best Practices" set of documents, we have been thinking along these lines, but such documents will have to wait until our new Web2.0 community is up and running. Christof was talking about it earlier today.

    Here's what I can say for .NET Applications:

    • Windows Forms and Compact Framework applications should both use db4o locally. Some WinForms apps may want to use in-process Client/Server. The question of wether or not to use a "tiered" approach is entirely up to the developer(s) working on the project. There are strong cases for both scenarios. Personally, I would prefer to use a "Smart" model, the UI, and db4o as my Business, UI, and Data tiers respectively. But for extremely large projects, or if I am anticipating very complex and modular business rules, I may elect to associate my data objects with externalized business logic classes. .NET has extremely powerful object Data Binding, which makes working with db4o super-easy.
    • ASP.NET applications are a little more involved. If you do not anticipate the need for shared data accross an entire web farm, then you may want to use db4o in File mode. But if you require a narrower transaction scope, or if you need to deploy across an entire webfarm, then you'll have to use Client/Server mode. But all the same patterns apply to ASP.NET as to WinForms applications, with one exception: Data Binding in web applications is entirely different. The ASP.NET ObjectDataSource pattern is vastly different from WinForms and traditional data binding. It requires you to warp your mind arround how ASP.NET really works, and does require a bit of code.

    Eric Falsken » db4objects
View as RSS news feed in XML