Using SubSonic for my own modules

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/21/2008 5:45:59 PM
Gravatar
Total Posts 33

Using SubSonic for my own modules

Hi Joe,

I have tried using subsonic to connect to Oracle database for my own little module, it worked, without integrating to mojo.

Right now I have set up mojo to run on sqlite, how do I integrate my oracle subsonic module into mojo? Is it possible for subsonic to connect to different types of dbs in the same project?

do i need to change this config here? <add key="SubSonicProvider" value="subsonicSQLite" />

cheers

James

8/22/2008 7:33:21 AM
Gravatar
Total Posts 18439

Re: Using SubSonic for my own modules

Hi James,

To be honest, I'm no longer using SubSonic for anything important in mojoportal and somewhere along the way I broke my custom build of SubSonic that used to work for Sqlite and it no longer works. I think I updated to a newer version of their files and then something got broken and I have not got around to solving it. At some point I would like to repair my custom build so I can at least use the scaffold pages in all the dbs, but right now the scaffold only works for me with MS SQL (using my broken custom build of SubSonic). But I have a lot of other higher priorites before I will get to that.

My main reasons for losing enthusiasm with SubSonic is just that I noticed it increases memory usage, looking at the code, they are doing a lot of string concatenation where they should be using stringbuilder. I like things to be fast and lightweight, and also when there is a problem in the data access code I like to be able to get right to the sql quickly and not have to debug through all the SubSonic stuff to figure out the problem. I've backed out the use of SubSonic in mojoportal everywhere except the developer scaffold, and as I mentioned it only works for MS SQL right now.

Wish I could be more help,

Best,

Joe

8/24/2008 4:19:40 PM
Gravatar
Total Posts 33

Re: Using SubSonic for my own modules

Thanks Joe.

James

8/25/2008 3:45:42 PM
Gravatar
Total Posts 33

Re: Using SubSonic for my own modules

Hi Joe,

if you are not planning to use subsonic anymore, are you going to remove the subsonic settings in the web.config file in the next release?

Cheers

James

8/25/2008 4:02:42 PM
Gravatar
Total Posts 18439

Re: Using SubSonic for my own modules

Even in the current release those settings have no effect unless you have enabled the hidden developer scaffold page:

<add key="DisableDBAdminTool" value="false" />
  <add key="ShowProviderListInDBAdminTool" value="true" />
  <add key="EnableDeveloperMenuInAdminMenu" value="true" />

The scaffold page currently does work for MS SQL (last time I checked) and at some point I will get it working again for the other dbs so I plan to leave the subsonic settings in there to support the scaffold. I still think SubSonic is a usefull tool, I'm just not using it for feature development and have backed it out of features where I was using it in previous versions.

Best,

Joe

8/25/2008 5:20:30 PM
Gravatar
Total Posts 33

Re: Using SubSonic for my own modules

Hi Joe,

I wamt to replace your subsonic settings in the web.config with mine in order to use subsonic against my oracle database. Hence the mojoportal will use MSSQL and my modules will levege subsonic for Oracle database.

However, I am a bit reluctant to do that because I am afraid the your future releases will be using subsonic as well, in result clash with my subsonic settings, as you know I have problem integrating subsonic into mojoportal with exsiting subsonic settings.

Could you please advise the mojo roadmap?

Regards

James

8/25/2008 6:24:28 PM
Gravatar
Total Posts 33

Re: Using SubSonic for my own modules

I sort of have a temp solution, by having a sub web.config file in the module folder, all the settings in sub web.config will override the main web.config

here is the content of my module web.config

<?xml version="1.0"?>
<configuration>

<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
</configSections>
<appSettings>
<add key="test" value="this is test"/>
<remove key="SubSonicProvider" />
</appSettings>
<connectionStrings>
<add name="module-AddressRegister" connectionString="Data Source=//server:1532/sidid;Persist Security Info=True;User ID=user;Password=pass;Pooling=true;"/>
</connectionStrings>
<SubSonicService defaultProvider="Address" enableTrace="false">
<providers>
<clear/>
<add name="Address" type="SubSonic.OracleDataProvider, SubSonic" connectionStringName="module-AddressRegister" generatedNamespace="Address"/>
</providers>
</SubSonicService>
<system.web>
</system.web>
</configuration>

You need to use the post build event to copy the files over into the modules folder, in this case my post build script creates a folder called "AddressRegister" inside the Modules directory in Web folder.

Joe, is this the right way to do it?

Cheers

James

 

8/26/2008 5:12:05 AM
Gravatar
Total Posts 18439

Re: Using SubSonic for my own modules

Hi James,

Any solution that works for you sounds good. I am going to continue including SubSonic but its only going to be used on this developer scaffold page which is disabled by default and is not really menat for use by site owners but only for developers. So its an unimportant feature and if you don't want it you can remove or replace my SubSonic settings in Web.config and replace the dll with your own. Or any other solution that works seems reasonable to me.

Best,

Joe

8/31/2008 7:55:07 PM
Gravatar
Total Posts 3

Re: Using SubSonic for my own modules

For future directions are you planning on completely moving away from SubSonic -- perhaps LINQ?  I am just starting to do development on mojoportal.  I downloaded subsonic, and now I'm considering just removing it.  I want to build a custom scheduler module... and am sort of trying to anticipate the direction mojoportal is going in general.

 

Thanks!

 

 

9/1/2008 5:59:36 AM
Gravatar
Total Posts 18439

Re: Using SubSonic for my own modules

Hi,

The first thing you should understand is the plugin model for feature development is very simple and the main integration is at the UI level so there is no limit on what you can use in your own custom development in terms of busines logic or data access. You don't have to do things the way I do them. If you like SubSonics, or LINQ, or NHibernate or whatever, there is nothing stopping you from using those things.

Myself, I do not like OR Mappers, I like straight forward sql code optimized for the specific db. I breifly became enamored with SubSonic because I thought it would make things easier to support for the non MS SQL data layers. But I found it added a lot of overhead and when there were problems it was much harder to debug my way through the subsonic code. I went back to just using Codesmith to generate standard dal code for each layer as a starting point for feature development. Its only a little more work on the front end to implement a true db specific dal than SubSonic and its easier to fix things because I can just go right to the sql when there is a bug, and less resources are used at runtime. As I've said, I think SubSonic is still useful in terms of developer scaffolding but I have no plans to use it going forward for production feature code.

I also have no plans to use LINQ to SQL or Entity framework in my own work.

At some point I would like to do some things with Silverlight, but thats the only big new feature beyond 2.0 .NET that really seems compelling to me. There are small things besides that that seem attractive like the new way you can combine all the javascript files and dynamic data, but I will be treading lightly about using that stuff for a while because I don't want to break compatibility with Mono.

For your scheduler project, you might want to look at DayPilot as something you could use in the UI. I used it in my new Event Calendar Pro product. The dll for the free open source version of DayPilot is already in the mojoportal solution in the _libs folder.

Best,

Joe

9/1/2008 11:30:43 PM
Gravatar
Total Posts 3

Re: Using SubSonic for my own modules

Thanks Joe!

You must sign in to post in the forums. This thread is closed to new posts.