CSLA .NET 3.0 Available

CSLA .NET 3.0 Available

Old forum URL: forums.lhotka.net/forums/t/3162.aspx


RockfordLhotka posted on Tuesday, July 10, 2007

CSLA .NET 3.0 CSLA .NET version 3.0 is now available for download.

See this blog post for the full announcement and details.

Also, catch the official release announcement on .NET Rocks!

ajj3085 replied on Tuesday, July 10, 2007

Great, this is before my next release!

I found a "bug" though; the C# solution doesn't compile if NET20 is defined. 

Error    1    The type or namespace name 'VisibilityMode' could not be found (are you missing a using directive or an assembly reference?)    C:\source\Csla\Csla\Wpf\AuthorizationPanel.cs    49    12    Csla

I'll comment that class myself for now though.

Andy

RockfordLhotka replied on Tuesday, July 10, 2007

Something is wrong then, because there’s no such thing as AuthorizationPanel anymore – it is now Authorizer.cs.

 

I just checked the zip file and it is correct – is it possibly you have some old code in your directory or something?

 

Rocky

 

From: ajj3085 [mailto:cslanet@lhotka.net]
Sent: Tuesday, July 10, 2007 11:01 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Available

 

Great, this is before my next release!

I found a "bug" though; the C# solution doesn't compile if NET20 is defined. 

Error    1    The type or namespace name 'VisibilityMode' could not be found (are you missing a using directive or an assembly reference?)    C:\source\Csla\Csla\Wpf\AuthorizationPanel.cs    49    12    Csla

I'll comment that class myself for now though.

Andy


ajj3085 replied on Tuesday, July 10, 2007

Opps... that's what it is.. sorry about that.

Stephen Richards replied on Tuesday, July 10, 2007

Rocky,

I'm sitting here listening to your show on .NET Rocks! and trying to compile the VB version of CSLA 3.0 on a machine with the .NET Framework 2.0 (but not 3.0) and I'm getting five "The referenced component could not be found"  warning messages.  Looking at Csla.vbproj, I see references to version 3.0.0.0 for PresentationCore, PresentationFramework, System.Runtime.Serialization, System.ServiceModel, and WindowsBase.

Can you tell me what I need to do to compile without installing version 3.0 of the Framework?  Thanks!

RockfordLhotka replied on Tuesday, July 10, 2007

Yes, you will get the warnings. There’s no way I know of to prevent them, because (I don’t believe) you can put compilation conditionals in a vbproj file.

 

If I’m wrong, and you can put conditional symbol checks in a vbproj file then I’m happy to do so.

 

Otherwise, these are just warnings and you can ignore them. Or you can go into the project’s references and remove the references to the missing assemblies.

 

Rocky

Stephen Richards replied on Tuesday, July 10, 2007

Thanks, the new DLL works great in my initial testing.

You may want to put a note about these warnings on http://www.lhotka.net/Article.aspx?id=ac20fe4c-6afc-4176-bcb4-d74b5a370356 because I'm sure I'm not the only one who will ask.

Stephen

RockfordLhotka replied on Tuesday, July 10, 2007

Stephen Richards:

Thanks, the new DLL works great in my initial testing.

You may want to put a note about these warnings on http://www.lhotka.net/Article.aspx?id=ac20fe4c-6afc-4176-bcb4-d74b5a370356 because I'm sure I'm not the only one who will ask.

Stephen

Excellent point - I've added a note to that effect, thanks!

Solutrian replied on Tuesday, July 10, 2007

I had two NUnit failures in the C# tests:

 

        Error expected 4 and returned 5, either are correct mine returned 5 

 

        public void AscendingSort()

        {

            int[] intArr = { 45, 23, 56, 56, 11, 87, 94, 44 };

            . . .

            Assert.AreEqual(true, sortedList.Contains(56));

            // as there are two values both 4 or 5 are correct indices 

            //Assert.IsTrue(4, sortedList.IndexOf(56)); <- mine retured 5

            // changed the test to:

            Assert.IsTrue(sortedList.IndexOf(56) == 4 || sortedList.IndexOf(56) == 5,

            "Expected either 4 or 5 for an index value, returned:"+sortedList.IndexOf(56).ToString());

 

 

Error Expected 1 returned 0

 

    [TestMethod()] This test is ok but it creates the per type rules before the next test

    public void StringRequired()

    {

      ApplicationContext.GlobalContext.Clear();

      ApplicationContext.GlobalContext["Shared"] = 0;

 

      HasPerTypeRules root = new HasPerTypeRules();();  ß--Sets per type rules in this test and sets shared to 1

      . . .

     }

 

    [TestMethod()]

    public void NoDoubleInit()

    {

      ApplicationContext.GlobalContext.Clear();

      ApplicationContext.GlobalContext["Shared"] = 0;

 

      HasPerTypeRules root = new HasPerTypeRules      root = new HasPerTypeRules();

      // this test fails as the per type rules were set in the previous test.

      Assert.AreEqual(1, (int)ApplicationContext.GlobalContext["Shared"], "Rules should init just once");

    }

 

Reversing the order of the methods fixes the test.

 

>> The later only happens when running the tests using TestDriven.Net

>> The former with both TestDriven.Net and NUnit v2.4.1

 

Thanks for sharing all your great work.

Jay

 

RockfordLhotka replied on Tuesday, July 10, 2007

Solutrian:

I had two NUnit failures in the C# tests:

That's odd. I just rechecked and the tests run fine for me.

Well, except for a missing reference to WindowsBase - so I did fix that and update the download.

RichardETVS replied on Thursday, July 12, 2007

I plan to write an ebook showing how to use the new features and enhancements in CSLA .NET 3.0. This ebook should be available in the third quarter of 2007 (probably September).

Should we wait to september to use CSLA .Net 3.0 ?

 

Thanks

 

Richard

RockfordLhotka replied on Thursday, July 12, 2007

That is entirely up to you.

 

3.0 is complete and released at this point, but obviously there is scant documentation – just the change log, ProjectTracker and some of the samples in svn. The 3.0 ebook will provide more documentation on how to use the new features, and I hope that it proves to be very valuable to people.

 

There are some important bug fixes in 3.0 however, especially in BusinessListBase and a couple other places – and with n-level undo in general. So if you are trying to do data binding in Windows Forms I suggest that you do want 3.0 as soon as you can get it.

 

The thing is this: other than some bug fixes, you can treat 3.0 just like 2.1.4. You can ignore the new features, and just use it as you’ve been using 2.1.4. Then when the ebook comes out you can choose to start using the new features based on that documentation.

 

It is also the case that many of the really interesting new features center around WCF and WPF. While there are some really nice enhancements elsewhere, they are largely optional (unless you really wanted “feature X” – in which case you probably know what it does already).

 

Rocky

 

 

From: RichardETVS [mailto:cslanet@lhotka.net]
Sent: Thursday, July 12, 2007 8:36 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Available

 

I plan to write an ebook showing how to use the new features and enhancements in CSLA .NET 3.0. This ebook should be available in the third quarter of 2007 (probably September).

Should we wait to september to use CSLA .Net 3.0 ?

 

Thanks

 

Richard



RichardETVS replied on Monday, July 16, 2007

Ok, thanks

 

Richard

petervdm replied on Monday, July 16, 2007

Hi

We were experiencing some EditLevel issues when we tried out RC2 of CSLA3 but resolved those by using the framework correctly.

I have just upgraded the solution to use the final release (12/7) and am experiencing EditLevel issues again (albeit in different places).

There is not too much difference in the code between the two CSLA releases (RC2 and 3) and so I am a bit baffled as to why we are having this issue.

Any ideas?

RockfordLhotka replied on Monday, July 16, 2007

I don't think anything changed from beta 2 to release - at least in regards to any n-level undo behaviors.

The only meaningful change to the core framework was to implement INotifyCollectionChanged (a CollectionChanged event) on BusinessListBase. That should not impact Windows Forms at all, because the event and interface are WPF concepts.

Patrick.Roeper replied on Thursday, July 19, 2007

RockfordLhotka:

The only meaningful change to the core framework was to implement INotifyCollectionChanged (a CollectionChanged event) on BusinessListBase. That should not impact Windows Forms at all, because the event and interface are WPF concepts.

Rocky,

On that note... We decided to implement a custom BusinessListBase class as well as a custom BusinessBase class when we started using CSLA. Our application does property level authentication based off of role user levels and a database defined data-dictionary (basically allowing the user to define what each role can see/edit). We figured the best implementation was to override the CanReadProperty and CanWriteProperty in our own implementation of the business base classes. Anyways, I took a copy of our solution (currently using the latest CSLA 2 version) off line to test it with the new CSLA 3.0 framework and I am getting an error with our BusinessListBase.

This is currently what the class declaration looks like...

public abstract class XEBusinessListBase<T, C> : BusinessListBase<T, C> where T : XEBusinessListBase<T, C>

where C : IEditableBusinessObject

Every one of our XEBusinessListBase objects now is throwing an error regarding 'INotifyCollectionChanged'.

Error 58 The type 'System.Collections.Specialized.INotifyCollectionChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 

So I guess I have 2 options? Make a reference to the .NET 3.0 WindowsBase assembly in all my Business Object assemblies or change something around with my custom BusinessListBase class. Can you give me some suggestions?

I briefly looked at your new BusinessListBase declaration and I noticed...

#if !NET20

, INotifyCollectionChanged

#endif

Is there a quick fix so I can get back to testing CSLA 3.0 with our application? Thanks!

RockfordLhotka replied on Thursday, July 19, 2007

You either need to reference the .NET 3.0 assemblies, or you need to build CSLA .NET without .NET 3.0 support

 

http://www.lhotka.net/Article.aspx?area=4&id=ac20fe4c-6afc-4176-bcb4-d74b5a370356

 

Rocky

 

 

From: Patrick.Roeper [mailto:cslanet@lhotka.net]
Sent: Thursday, July 19, 2007 3:41 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.0 Available

 

RockfordLhotka:

The only meaningful change to the core framework was to implement INotifyCollectionChanged (a CollectionChanged event) on BusinessListBase. That should not impact Windows Forms at all, because the event and interface are WPF concepts.

Rocky,

On that note... We decided to implement a custom BusinessListBase class as well as a custom BusinessBase class when we started using CSLA. Our application does property level authentication based off of role user levels and a database defined data-dictionary (basically allowing the user to define what each role can see/edit). We figured the best implementation was to override the CanReadProperty and CanWriteProperty in our own implementation of the business base classes. Anyways, I took a copy of our solution (currently using the latest CSLA 2 version) off line to test it with the new CSLA 3.0 framework and I am getting an error with our BusinessListBase.

This is currently what the class declaration looks like...

public abstract class XEBusinessListBase<T, C> : BusinessListBase<T, C> where T : XEBusinessListBase<T, C>

where C : IEditableBusinessObject

Every one of our XEBusinessListBase objects now is throwing an error regarding 'INotifyCollectionChanged'.

Error 58 The type 'System.Collections.Specialized.INotifyCollectionChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 

So I guess I have 2 options? Make a reference to the .NET 3.0 WindowsBase assembly in all my Business Object assemblies or change something around with my custom BusinessListBase class. Can you give me some suggestions?

I briefly looked at your new BusinessListBase declaration and I noticed...

#if !NET20

, INotifyCollectionChanged

#endif

Is there a quick fix so I can get back to testing CSLA 3.0 with our application? Thanks!



Patrick.Roeper replied on Thursday, July 19, 2007

Annnddddd it builds again. Thanks Rocky.

culprit replied on Wednesday, September 05, 2007

Rocky,

One BusinessBase I have contains a child BusinessListBase similar to the Project/Resources (ProjectEdit Form) you have in ProjectTracker. I am not pulling the data for the child from a DB but just creating each child as a new object. I am binding to a TreeList instead of a grid. I dont know what I am doing wrong but the child never shows as being dirty.

ADDED: I tested this as well with the DataGrid with not difference. I also examined the ChildList on form load and verified the data in each Child in the collection (16). I then changed the value of the only editable property (a boolean Checked value) in the child, confirmed that it indeed was changed at the beginning of the Save procedure but the IsDirty flag on this child, even though changed, was still False. I am sure it is something simple I am doing wrong.

Also, when editing a Project in ProjectTracker (new 3.0) and clicking Apply the form just reloads empty. This is the code I am using in my project; I wonder if there is a problem with this code.

Thank You,

Rob

culprit replied on Wednesday, September 05, 2007

One other quick question: I notice that we went from EndEdit() on the BindingSource to ApplyEdit() and BeginEdit() on the CSLA object, would you mind explaining this change? Also, we have a lot of code like 2.1 code where we are firing the EndEdit() function and then rebinding by setting DataSource to nothing and then back to the BO; is this method still okay? It seems to work okay even with the 3.0 CSLA.

Thank You,

Rob

RockfordLhotka replied on Wednesday, September 05, 2007

Read through this thread regarding data binding

http://forums.lhotka.net/forums/1/16971/ShowThread.aspx

The only correct code out there now is found in 3.0.2, at least for parent-child data in the same form, where you want a form-level Cancel button. That is the code I'll be discussing in the 3.0 ebook.

Things are a little simpler if you don't have parent-child data, but the same pattern is still required.

Things are much simpler if you don't have a form-level Cancel button, because then there's never a need to call any n-level undo methods directly on the business object. In that case you only call the methods on the bindingsource.

culprit replied on Wednesday, September 05, 2007

Rocky,

I think I found why the ProjectEdit form did not reload after clicking the Apply button. (I am using the VB version) The "rebind" If statement was inside the Else side of the If SaveObject statement. I put it in the finally section and it seems to work okay.

Rob

culprit replied on Wednesday, September 05, 2007

Sorry to query so much but I noticed another slight difference when editing now compared to before. Now if you do not move the focus away from the edited control (ie - Checkbox) it does not see this as a change. I think this may be because now we are not performing EndEdit on the bindingsource. Do you have an alternative way we can commit any changes to the currently focused control without leaving that control?

Thank You,

Rob

RockfordLhotka replied on Wednesday, September 05, 2007

I don’t follow you? You _must_ call EndEdit() on the bindingsource, then unbind it, then call ApplyEdit() on the business object.

 

The UnbindBindingSource() method calls EndEdit() or CancelEdit() as appropriate.

 

Rocky

 

From: culprit [mailto:cslanet@lhotka.net]
Sent: Wednesday, September 05, 2007 2:18 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.0 Available

 

Sorry to query so much but I noticed another slight difference when editing now compared to before. Now if you do not move the focus away from the edited control (ie - Checkbox) it does not see this as a change. I think this may be because now we are not performing EndEdit on the bindingsource. Do you have an alternative way we can commit any changes to the currently focused control without leaving that control?

Thank You,

Rob



culprit replied on Thursday, September 06, 2007

Rocky,
I am sorry to email you directly to ask you this but this is driving me crazy. We are implementing CSLA in a very large project and I just have one issue that I cant seem to get around.
 
I am creating a ChildCollection and Child objects manually by parsing a string and then bind the parent to a form and the child to a grid. I change the value on the child's Checked property and when I analyze the Child's properties before saving it does show the new value but the IsDirty flag on the child collection is still False. I am not sure what to do to make this flag change or what I can do to force the object to save itself when the child collection has changed. Below I have included the relevant code in the parent object and the full code for the ChildCollection and Child:
 
Parent:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Private _claimFields As InsuranceFields = ScriptAssist.InsuranceFields.NewInsuranceFields()
 
Public ReadOnly Property ClaimFields() As ScriptAssist.InsuranceFields
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
CanReadProperty("Claimfields", True)
Return _claimFields
End Get
End Property

 
Public Overrides ReadOnly Property IsValid() As Boolean
Get
Return MyBase.IsValid AndAlso _claimFields.IsValid
End Get
End Property
Public Overrides ReadOnly Property IsDirty() As Boolean
Get
Return MyBase.IsDirty OrElse _claimFields.IsDirty
End Get
End Property
 
_claimFields = InsuranceFields.GetInsuranceFields(_claimFieldsText)
 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
Child Collection
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Csla
Imports Csla.Data
<Serializable()> _
Public Class InsuranceFields
Inherits BusinessListBase(Of InsuranceFields, InsuranceField)
#
Region " BindingList Overrides "
Protected Overrides Function AddNewCore() As Object
Dim item As InsuranceField = InsuranceField.NewInsuranceField
Me.Add(item)
Return item
End Function
#End Region ' BindingList Overrides
#Region " Factory Methods "
Friend Shared Function NewInsuranceFields() As InsuranceFields
Return New InsuranceFields()
End Function
Friend Shared Function GetInsuranceFields(ByVal ClaimFields As String) As InsuranceFields
Return New InsuranceFields(ClaimFields)
End Function
Private Sub New()
MarkAsChild()
End Sub
Private Sub New(ByVal ClaimFields As String)
MarkAsChild()
Fetch(ClaimFields)
End Sub
#End Region ' Factory Methods
#Region " Data Access "
Public Function GetClaimFields() As String
Dim sClaimFields As String = ""
For Each Field As InsuranceField In Me
If Field.Checked = True Then
sClaimFields = sClaimFields & Field.Key
End If
Next
Return sClaimFields
End Function
Private Sub Fetch(ByVal ClaimFields As String)
RaiseListChangedEvents =
False
'Here aer the 3.2 only fields
Me.Add(InsuranceField.GetInsuranceField("CF,CG,CH,CI,CJ,CK-", "Employer Fields", CBool(InStr(ClaimFields, "CF"))))
Me.Add(InsuranceField.GetInsuranceField("DY-", "Date of Injury", CBool(InStr(ClaimFields, "DY"))))
Me.Add(InsuranceField.GetInsuranceField("DZ-", "Claim/Ref (Injury Type)", CBool(InStr(ClaimFields, "DZ"))))
'Fields common between 3.2 and 5.1
Me.Add(InsuranceField.GetInsuranceField("CM,CN,CO,CP-", "Patient Address", CBool(InStr(ClaimFields, "CM"))))
Me.Add(InsuranceField.GetInsuranceField("CQ-", "Patient Phone", CBool(InStr(ClaimFields, "CQ"))))
Me.Add(InsuranceField.GetInsuranceField("DR-", "Physician Last Name", CBool(InStr(ClaimFields, "DR"))))
'Fields unique to 5.1
Me.Add(InsuranceField.GetInsuranceField("CA,CB-", "Patient Name", CBool(InStr(ClaimFields, "CA"))))
Me.Add(InsuranceField.GetInsuranceField("CX-", "Patient SSN", CBool(InStr(ClaimFields, "CX"))))
Me.Add(InsuranceField.GetInsuranceField("EJ-", "Orig Product ID Qualifier", CBool(InStr(ClaimFields, "EJ"))))
Me.Add(InsuranceField.GetInsuranceField("AM06-", "WC Segment", CBool(InStr(ClaimFields, "AM06"))))
Me.Add(InsuranceField.GetInsuranceField("EA-", "Orig Product Code", CBool(InStr(ClaimFields, "EA"))))
Me.Add(InsuranceField.GetInsuranceField("EB-", "Orig Prescribed Qty", CBool(InStr(ClaimFields, "EB"))))
Me.Add(InsuranceField.GetInsuranceField("AM13-", "Include Clinical Seg", CBool(InStr(ClaimFields, "AM13"))))
Me.Add(InsuranceField.GetInsuranceField("MED-", "Medicare Format", CBool(InStr(ClaimFields, "MED"))))
Me.Add(InsuranceField.GetInsuranceField("DX-", "Send Copay", CBool(InStr(ClaimFields, "DX"))))
Me.Add(InsuranceField.GetInsuranceField("2E-", "Include PCP ID", CBool(InStr(ClaimFields, "2E"))))
RaiseListChangedEvents =
True
End Sub
#End Region ' Data Access
End Class
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
Child
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Csla
Imports Csla.Data
Imports Csla.Validation
<Serializable()> _
Public Class InsuranceField
Inherits BusinessBase(Of InsuranceField)
#
Region " Business Properties and Methods "
' declare members
Private _ID As Guid = Guid.Empty
Private _key As String = ""
Private _name As String = ""
Private _checked As Boolean = False
<System.ComponentModel.DataObjectField(True, True)> _
Public ReadOnly Property ID() As Guid
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _ID
End Get
End Property
Public Property Key() As String
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _key
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As String)
_key = value
End Set
End Property
Public Property Name() As String
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _name
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property Checked() As Boolean
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _checked
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As Boolean)
_checked = value
End Set
End Property
''' <summary>
''' Get the unique id for the current object.
''' </summary>
''' <returns>A value that is the unique id of the object.</returns>
''' <remarks></remarks>
Protected Overrides Function GetIdValue() As Object
Return _ID
End Function
#End Region ' Business Properties and Methods
#Region " Validation Rules "
''' <summary>
''' Method that allows the addition of custom business rules.
''' </summary>
''' <remarks></remarks>
Private Sub AddCustomRules()
'todo: add custom/non-generated rules here...
End Sub
''' <summary>
''' Method that allows the addition of shared custom business rules.
''' </summary>
''' <remarks></remarks>
Private Sub AddSharedCustomRules()
'todo: add custom/non-generated shared rules here...
End Sub
''' <summary>
''' Method used to instigate the addition of all Business rules both Custom and Common.
''' </summary>
''' <remarks></remarks>
Protected Overrides Sub AddInstanceBusinessRules()
AddCustomRules()
MyBase.AddBusinessRules()
End Sub
''' <summary>
''' Method that allows the addition of shared common business rules.
''' </summary>
''' <remarks>These rules represent the database defaults that can be generated.</remarks>
Private Sub AddSharedCommonRules()
End Sub
''' <summary>
''' Method used to instigate the addition of all Business rules both Custom and Common.
''' </summary>
''' <remarks></remarks>
Protected Overrides Sub AddBusinessRules()
AddSharedCommonRules()
AddSharedCustomRules()
MyBase.AddBusinessRules()
End Sub
#End Region ' Validation Rules
#Region " Authorization Rules "
Protected Overrides Sub AddAuthorizationRules()

End Sub
#End Region ' Authorization Rules
#Region " Factory Methods "
Friend Shared Function NewInsuranceField() As InsuranceField
Return New InsuranceField()
End Function
Friend Shared Function GetInsuranceField(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean) As InsuranceField
Return New InsuranceField(Key, Name, Checked)
End Function
Private Sub New()
ValidationRules.CheckRules()
MarkAsChild()
End Sub
Private Sub New(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean)
MarkAsChild()
Fetch(Key, Name, Checked)
End Sub
#End Region ' Factory Methods
#Region "Data Access"
Private Sub Fetch(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean)
_ID = Guid.NewGuid
_key = Key
_name = Name
_checked = Checked
MarkOld()
ValidationRules.CheckRules()
End Sub
#End Region
End
Class
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
I greatly appreciate your insight on this issue. I would prefer to remove much of the validation/authorization and other unneeded code from the ChildCollection and Child if possible.
 
Sincerely,
Rob
 


Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!

RockfordLhotka replied on Thursday, September 06, 2007

You have to call PropertyHasChanged() in your set blocks, or no one will know that the property has changed.

 

Rocky

 

From: Rob Standridge [mailto:cslanet@lhotka.net]
Sent: Thursday, September 06, 2007 11:45 AM
To: rocky@lhotka.net
Subject: RE: [CSLA .NET] RE: CSLA .NET 3.0 Available

 

Rocky,
I am sorry to email you directly to ask you this but this is driving me crazy. We are implementing CSLA in a very large project and I just have one issue that I cant seem to get around.
 
I am creating a ChildCollection and Child objects manually by parsing a string and then bind the parent to a form and the child to a grid. I change the value on the child's Checked property and when I analyze the Child's properties before saving it does show the new value but the IsDirty flag on the child collection is still False. I am not sure what to do to make this flag change or what I can do to force the object to save itself when the child collection has changed. Below I have included the relevant code in the parent object and the full code for the ChildCollection and Child:
 
Parent:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Private _claimFields As InsuranceFields = ScriptAssist.InsuranceFields.NewInsuranceFields()
 
Public ReadOnly Property ClaimFields() As ScriptAssist.InsuranceFields
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
CanReadProperty("Claimfields", True)
Return _claimFields
End Get
End
Property

 
Public Overrides ReadOnly Property IsValid() As Boolean
Get
Return
MyBase.IsValid AndAlso _claimFields.IsValid
End Get
End
Property
Public
Overrides ReadOnly Property IsDirty() As Boolean
Get
Return
MyBase.IsDirty OrElse _claimFields.IsDirty
End Get
End
Property
 
_claimFields = InsuranceFields.GetInsuranceFields(_claimFieldsText)
 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
Child Collection
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Imports
System
Imports
System.Data
Imports
System.Data.SqlClient
Imports
Csla
Imports
Csla.Data
<Serializable()> _
Public
Class InsuranceFields
Inherits BusinessListBase(Of InsuranceFields, InsuranceField)
#Region
" BindingList Overrides "
Protected Overrides Function AddNewCore() As Object
Dim item As InsuranceField = InsuranceField.NewInsuranceField
Me.Add(item)
Return item
End Function
#End Region
' BindingList Overrides
#Region " Factory Methods "
Friend Shared Function NewInsuranceFields() As InsuranceFields
Return New InsuranceFields()
End Function
Friend Shared Function GetInsuranceFields(ByVal ClaimFields As String) As InsuranceFields
Return New InsuranceFields(ClaimFields)
End Function
Private Sub New()
MarkAsChild()
End Sub
Private Sub New(ByVal ClaimFields As String)
MarkAsChild()
Fetch(ClaimFields)
End Sub
#End Region
' Factory Methods
#Region " Data Access "
Public Function GetClaimFields() As String
Dim sClaimFields As String =
""
For Each Field As InsuranceField In Me
If Field.Checked = True Then
sClaimFields = sClaimFields & Field.Key
End If
Next
Return sClaimFields
End Function
Private Sub Fetch(ByVal ClaimFields As String)
RaiseListChangedEvents = False
'Here aer the 3.2 only fields
Me.Add(InsuranceField.GetInsuranceField("CF,CG,CH,CI,CJ,CK-", "Employer Fields", CBool(InStr(ClaimFields, "CF"))))
Me.Add(InsuranceField.GetInsuranceField(
"DY-", "Date of Injury", CBool(InStr(ClaimFields, "DY"))))
Me.Add(InsuranceField.GetInsuranceField(
"DZ-", "Claim/Ref (Injury Type)", CBool(InStr(ClaimFields, "DZ"))))
'Fields common between 3.2 and 5.1
Me.Add(InsuranceField.GetInsuranceField("CM,CN,CO,CP-", "Patient Address", CBool(InStr(ClaimFields, "CM"))))
Me.Add(InsuranceField.GetInsuranceField(
"CQ-", "Patient Phone", CBool(InStr(ClaimFields, "CQ"))))
Me.Add(InsuranceField.GetInsuranceField(
"DR-", "Physician Last Name", CBool(InStr(ClaimFields, "DR"))))
'Fields unique to 5.1
Me.Add(InsuranceField.GetInsuranceField("CA,CB-", "Patient Name", CBool(InStr(ClaimFields, "CA"))))
Me.Add(InsuranceField.GetInsuranceField(
"CX-", "Patient SSN", CBool(InStr(ClaimFields, "CX"))))
Me.Add(InsuranceField.GetInsuranceField(
"EJ-", "Orig Product ID Qualifier", CBool(InStr(ClaimFields, "EJ"))))
Me.Add(InsuranceField.GetInsuranceField(
"AM06-", "WC Segment", CBool(InStr(ClaimFields, "AM06"))))
Me.Add(InsuranceField.GetInsuranceField(
"EA-", "Orig Product Code", CBool(InStr(ClaimFields, "EA"))))
Me.Add(InsuranceField.GetInsuranceField(
"EB-", "Orig Prescribed Qty", CBool(InStr(ClaimFields, "EB"))))
Me.Add(InsuranceField.GetInsuranceField(
"AM13-", "Include Clinical Seg", CBool(InStr(ClaimFields, "AM13"))))
Me.Add(InsuranceField.GetInsuranceField(
"MED-", "Medicare Format", CBool(InStr(ClaimFields, "MED"))))
Me.Add(InsuranceField.GetInsuranceField(
"DX-", "Send Copay", CBool(InStr(ClaimFields, "DX"))))
Me.Add(InsuranceField.GetInsuranceField(
"2E-", "Include PCP ID", CBool(InStr(ClaimFields, "2E"))))
RaiseListChangedEvents = True
End Sub
#End Region
' Data Access
End Class
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
Child
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Imports
System
Imports
System.Data
Imports
System.Data.SqlClient
Imports
Csla
Imports
Csla.Data
Imports
Csla.Validation
<Serializable()> _
Public
Class InsuranceField
Inherits BusinessBase(Of InsuranceField)
#Region
" Business Properties and Methods "
' declare members
Private _ID As Guid = Guid.Empty
Private _key As String =
""
Private _name As String = ""
Private _checked As Boolean = False
<System.ComponentModel.DataObjectField(True, True)> _
Public ReadOnly Property ID() As Guid
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _ID
End Get
End Property
Public Property Key() As String
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _key
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As String)
_key = value
End Set
End Property
Public Property Name() As String
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _name
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property Checked() As Boolean
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Get
Return _checked
End Get
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
Set(ByVal value As Boolean)
_checked = value
End Set
End Property
''' <summary>
''' Get the unique id for the current object.
'''
</summary>
''' <returns>A value that is the unique id of the object.</returns>
''' <remarks></remarks>
Protected Overrides Function GetIdValue() As Object
Return _ID
End Function
#End Region
' Business Properties and Methods
#Region " Validation Rules "
''' <summary>
''' Method that allows the addition of custom business rules.
'''
</summary>
''' <remarks></remarks>
Private Sub AddCustomRules()
'todo: add custom/non-generated rules here...
End Sub
''' <summary>
''' Method that allows the addition of shared custom business rules.
'''
</summary>
''' <remarks></remarks>
Private Sub AddSharedCustomRules()
'todo: add custom/non-generated shared rules here...
End Sub
''' <summary>
''' Method used to instigate the addition of all Business rules both Custom and Common.
'''
</summary>
''' <remarks></remarks>
Protected Overrides Sub AddInstanceBusinessRules()
AddCustomRules()
MyBase.AddBusinessRules()
End Sub
''' <summary>
''' Method that allows the addition of shared common business rules.
'''
</summary>
''' <remarks>These rules represent the database defaults that can be generated.</remarks>
Private Sub AddSharedCommonRules()
End Sub
''' <summary>
''' Method used to instigate the addition of all Business rules both Custom and Common.
'''
</summary>
''' <remarks></remarks>
Protected Overrides Sub AddBusinessRules()
AddSharedCommonRules()
AddSharedCustomRules()
MyBase.AddBusinessRules()
End Sub
#End Region
' Validation Rules
#Region " Authorization Rules "
Protected Overrides Sub AddAuthorizationRules()

End Sub
#End Region
' Authorization Rules
#Region " Factory Methods "
Friend Shared Function NewInsuranceField() As InsuranceField
Return New InsuranceField()
End Function
Friend Shared Function GetInsuranceField(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean) As InsuranceField
Return New InsuranceField(Key, Name, Checked)
End Function
Private Sub New()
ValidationRules.CheckRules()
MarkAsChild()
End Sub
Private Sub New(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean)
MarkAsChild()
Fetch(Key, Name, Checked)
End Sub
#End Region
' Factory Methods
#Region "Data Access"
Private Sub Fetch(ByVal Key As String, ByVal Name As String, ByVal Checked As Boolean)
_ID = Guid.NewGuid
_key = Key
_name = Name
_checked = Checked
MarkOld()
ValidationRules.CheckRules()
End Sub
#End Region
End
Class
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
I greatly appreciate your insight on this issue. I would prefer to remove much of the validation/authorization and other unneeded code from the ChildCollection and Child if possible.
 
Sincerely,
Rob
 


Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!



culprit replied on Thursday, September 06, 2007

I know this goes along with some saying about the Forest but can't remember it. Thankfully I did not go into rocket science.

Thank you Rocky

jhoojharsinghyadav replied on Wednesday, September 12, 2007

Rocky,

I do have a querry when coming over to the business base, readonlylist classes/objects.

so far as my understanding is concerned here is what i do have concluded from the different kind of objects .

1. ReadOnlyBase i.e NonTransactionalBusinessObject (as it contains all the definiton of buisness object to be displayed on List forms i.e projectlist etc)
2. ReadonlyList i.e NonTransactionalBusinessComponent( as it implements the readonly base object )

but coming over to the businessbase object .which i do term as TransactionalBusinessComponent it do contains the TranasactionalBusinessObject in itself as well as its implementation .

what i am curious about is ,why this object is not implementing something like TransactionalBusinesobject like Readonlybase which do contains all the definition for the business object , its validation rules
such that when coding large business objects say as invoice which can contain upto 100 properties , then this kind of implementation is quite neat and clean .
as BusinessObject lies different and TransactionlaComponet diffrently .

Thanks
Govind

RockfordLhotka replied on Wednesday, September 05, 2007

Thanks, it is now correct in svn.

 

Rocky

 

From: culprit [mailto:cslanet@lhotka.net]
Sent: Wednesday, September 05, 2007 1:54 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.0 Available

 

Rocky,

I think I found why the ProjectEdit form did not reload after clicking the Apply button. (I am using the VB version) The "rebind" If statement was inside the Else side of the If SaveObject statement. I put it in the finally section and it seems to work okay.

Rob



jhoojharsinghyadav replied on Monday, July 23, 2007

Hi Rocky,

I am quite new to CSLA .

BUt had worked on similar kind of architechtures in my previos projects .

in my current project ,  i am planning to use CSLA + AJAX+WF+PAGEFLOWS+WCF+ENT LIB 3.0 +ASP.NET PROVIDERS 

Would it be possible to have a integration of all the things and move ahead smmmotthly , coz not using csla providers for the very reason had used the aspnet_DB and customised it a lot with extending the default providers and would be troublesome for me to move back to start from begining .
and need wf / pageflows to control whole of the flow of application and pages with several action buttons .
ajax inddedd will be required .

Awaiting your valuable answer to this .

thanks
Govind

RockfordLhotka replied on Monday, July 23, 2007

I’m not sure I understand the question.

 

Yes, you can use all those technologies together.

 

But if you are asking if you can use the ASP.NET ObjectDataSource control with CSLA objects the general answer is no. The ObjectDataSource control is designed to work primarily with DataTables, and as a bonus it works with data transfer objects (DTOs). But, as I discuss in the book, it simply can’t handle the more complex business objects you typically create using CSLA .NET (objects with read-only properties, validation rules, private constructors, etc).

 

If you are asking about the ASP.NET membership providers, then the answer is yes. You can use the ASP.NET membership provider instead of Windows or CSLA custom authentication – as long as you don’t have a separate application server.

 

And even if you do have a separate application server, you can still use the ASP.NET membership provider, but you need to wrap their principal object with a custom principal object. This is discussed in Chapter 10.

 

Rocky

 

From: jhoojharsinghyadav [mailto:cslanet@lhotka.net]
Sent: Monday, July 23, 2007 9:12 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Available

 

Hi Rocky,

I am quite new to CSLA .

BUt had worked on similar kind of architechtures in my previos projects .

in my current project ,  i am planning to use CSLA + AJAX+WF+PAGEFLOWS+WCF+ENT LIB 3.0 +ASP.NET PROVIDERS 

Would it be possible to have a integration of all the things and move ahead smmmotthly , coz not using csla providers for the very reason had used the aspnet_DB and customised it a lot with extending the default providers and would be troublesome for me to move back to start from begining .
and need wf / pageflows to control whole of the flow of application and pages with several action buttons .
ajax inddedd will be required .

Awaiting your valuable answer to this .

thanks
Govind



jhoojharsinghyadav replied on Tuesday, July 24, 2007

Rocky , IT sounds great , here is my scenario elaborated. 1. i had extended the default providers for asp.net (membership,profile,sqlsitemap) and yes the application server is same , and database is 1 for the application and aspnetdb 2. i am going to use the principal and identity extended with custom principal and identity objects. 3. the application is asp.net + ajax + CSLA + ENTLIB3.0 4. the application will have complex workflows and pageflows so do require workflows/pageflows to control the business flow of applciation 5 now i want to up using SOA kind of implementation using all the above things i.e using webservices (WCF) but not sure how to move ahead with . 6. if could it b possible , that i do share up some of the basic designs of my app with you , and you could suggest how to implement soa on the same using all the above methodologies . Thanks Govind

RockfordLhotka replied on Tuesday, July 24, 2007

I can't provide free consulting, no. However, here are a couple suggestions:

  1. You can post your approach in a new thread on this forum and see if anyone on the forum has any comments
  2. I wrote a whole series of blog posts about SOA, which might be useful
  3. I can put you in touch with a Magenic sales person, because Magenic does provide architecture and design review as a consulting service

 

jhoojharsinghyadav replied on Tuesday, July 31, 2007

hi rocky,
after quite a load of headhunting with the csla sample being provided by you .i do have a couple of querries to be asked . before that here are my observations and conclusions based on that headhunting please correct if wrong somewhere

1. the project library that is the business logic as far as i had consumed knowledge of that
2. in that library there is one interesting thing , that is the whole of the business entity and the business logic is being implemented in a single class ,
3. then this class can be compiled in a single dll and used directly with an asp.net application .
4.so this becomes 3 layer architechture i.e database,businesslogic and presentation
5. if my deployment is 2 tier i.e database resides on 1 server and the businesslogic with asp.net files on other then it does works fine with same'

now i wnat to go for 3 tier deployment i.e my busines logic on application server , the datbase , and the iis hosting asp.net pages.

1.would it  be better  to go with  webservices  or  just simply remoting  or  use wcf  for the purpose.
2. in  business logic whole of the logic  +  entities are defined into one class  , i ll go for  2  classes for the same respectively one pure business entity , and the other business logic.
3. for dataaccess ill go with enterrpise library DAABS .
4. the next big thing to integrate between them is the workflows i.e wf so would implement a diff layer for tat and deploy it on the iis server .
5. the validation rules , can it be gud to go for validation blocks or continue using the validation rules .
also i dont want post backs to get the validation rules be fired but instead want them to get raised before any of the event without getting the pge post back like as its getting done on windows implementation where the validation for start and end date if wrong gets fired immediatley without causing any event to be fired
6. regarding the latest relesae of csla 3.0 it is using wcf , but on viewing the project code , my founding was that the webservice layer do had the same duplication of code for business entites as was being there at the project tracker library ., so dint get the clear vison of why the code duplicacy is there inspite of fact it is using the project library also

8. in the projectlibrary there is a class projectinfo , but i couldnt get where this is being exactly used up
if i m not wrong on same the implementatin goes like this ,
the project class do contains all the attributes which do are being required to make a new entry,update for projects.
while the projectinfo class is merely being used for the list purpose i.e  the listings of all the projects in conjunction to the project list .
so now for one simple object project there do exist at least 5  classes -projectinfo,projectlist,project,projectresource,projectresources .
is it necessary to follow the same structure for everyobject to go as in accordance with csla .

could you please through up some light on the same

thanks
govind


RockfordLhotka replied on Tuesday, July 31, 2007

jhoojharsinghyadav:
hi rocky,
now i wnat to go for 3 tier deployment i.e my busines logic on application server , the datbase , and the iis hosting asp.net pages.

I strongly suggest you read chapters 1 and 2 of the Expert C#/VB 2005 Business Objects book, because those chapters discuss the intended and supported architectures for CSLA .NET. In fact, "CSLA" stands for component-based, scalable, logical architecture and so it is an architecture first, and a framework second.

CSLA is designed to put the business logic on both the client and app server using the concept of mobile objects.

I personally recommend against building web apps where the business logic is all on the app server. This means that every web request must go to the web server, then to the app server, probably to the database server and back to the user. The performance will usually be bad.

But if you really want to do that, then I suggest you limit your use of CSLA to the app server, and build your app server to expose a set of services as discussed in Chapter 11. Then you can build your web application to consume the web services, data binding directly to the service proxy objects. That will help keep the overhead as low as possible on the web server - which must be a goal for any hope of performance in such an archirecture.

jhoojharsinghyadav replied on Wednesday, August 01, 2007

hi rocky,

yes i had read those chapters being suggested by you .

as being suggested by you , i would rather choose to be on using the 2-tier architechture viz : application server + iis and dataserver .

so now it comes out that for this kind of a architechture  i would be required only to implement the csla in library section and use them directly to my asp.net pages ( correct if wrong ) . and later on if required to sepaarate the application layer will implement a new layer for that but that woudl require a change of all so to avoid it what i feels is i go up with a wrapper layer which would give call to the library layer and then use that wrapper layer itself directly into my project . so as to when the web service layer is implemented it goes in betwwen the wrapper layer and library layer rather then wrapper layer and the presentation layer .

databse->librarylayer->wrapperlayer->asp.net

database->librarylayer->webservices/proxies->wrapperlayer->asp.net

no change required for front end as is .

one more request , i would like to begin a new forum thread to share up this with the forum users and get their valuable comments/suggestions on same .would it b possible for me to start a new thread of my own and watch it on continously .

thanks

govind

 

RockfordLhotka replied on Wednesday, August 01, 2007

jhoojharsinghyadav:

so now it comes out that for this kind of a architechture  i would be required only to implement the csla in library section and use them directly to my asp.net pages ( correct if wrong ) . and later on if required to sepaarate the application layer will implement a new layer for that but that woudl require a change of all so to avoid it what i feels is i go up with a wrapper layer which would give call to the library layer and then use that wrapper layer itself directly into my project . so as to when the web service layer is implemented it goes in betwwen the wrapper layer and library layer rather then wrapper layer and the presentation layer .

I suppose you could do that, but that would make it difficult to get a lot of benefit from CSLA.

Remember that CSLA includes the data portal, which is designed so you can change from a two tier to a three tier architecture. When you use the data portal to do this, you are using mobile objects, and so the business layer runs on both the web server and application server.

The result is that you get the best of all worlds. The business logic that can run on the web server does run there. The business and data access logic that needs to run on the application server runs there.

jhoojharsinghyadav:

one more request , i would like to begin a new forum thread to share up this with the forum users and get their valuable comments/suggestions on same .would it b possible for me to start a new thread of my own and watch it on continously .

Of course! That is a very good idea.

jhoojharsinghyadav replied on Wednesday, August 01, 2007

Hi rocky,

thanks for your valuable suggestions

coming on to the webservice part being implemented with project tracker and after going throught the chapter 11 here is my understandng of the same .

1. credential class is being implemented as a supportive class to pass on the user credentials so as to authenticate him prior mamking any call to the web methods.

my question is , does there do exist or possible a way so as to my websrvice calls become as simple as i am making calls to the buisness objects i mean mobile webmethods as the mobile objects are .

also please do suggest me the way to start up a new thread . as i was being unable to locate that .

thanks

govind

 

RockfordLhotka replied on Wednesday, August 01, 2007

jhoojharsinghyadav:

also please do suggest me the way to start up a new thread . as i was being unable to locate that .

Go here: http://forums.lhotka.net/forums/5/ShowForum.aspx

And click on the New Post button in the upper left.

jhoojharsinghyadav replied on Wednesday, August 29, 2007

Rocky, I am implementing RBAC(role based access control system in my APP). for which my roles (custom) will be having permissions sets rights on objects .
example :Customer (Add,update,view,delete,authorise,confirm) etc

this method is there to get the users authentication for the specified action
public static bool CanAddObject()
{
return Csla.ApplicationContext.User.IsInRole( "ProjectManager");
 }

but i dont want to hard code the roles , "ProjectManager" etc instead i would like to go for a custom implementation of the above method like
public static bool CanAddObject()
{ return Csla.ApplicationContext.User.hasRight(enumActions.Add,enumObjects.Customer,user.rol);
 }

or in this way

public static bool CanAddObject()
{ return
Csla.ApplicationContext.User.IsInRoles(getRolesforAction(enumActions.Add,enumObjects.Customer);
}

Could this kind be of thing possible to achieve with CSLA or it do require the base modifications at CSLA level . thanks govind

jhoojharsinghyadav replied on Wednesday, August 29, 2007

Rocky,

1 more thing , why there isnt any place for permissions . in CSLa , may be i could be wrong as i cant find them .
but as per mine understanding it should go like this ,
a permission base class should be there and instead of checking the user.inrole at every action (add,delete) etc  it should go like for asking the user.haspermission(permissionname)  .

and the permission names could be stored up in a separate out of box  xml file, sql , config  any where .

what you say about this kind of implementation with csla , as per my understanding it will be an extension to the existing role base management and will be a deep dive into the same .
thanks
govind

JoeFallon1 replied on Wednesday, August 29, 2007

govind,

I use both Roles and Permissions exactly as you describe.

Rocky is aware of the issue and has added a Delegate for IsInRole to the wish list. He just hasn't gotten around to implementing it yet.

Joe

 

jhoojharsinghyadav replied on Thursday, August 30, 2007

hi joe,

Yes i am too in process of implementing the same . and once achieved will post it over .

i am going with permission set rather then being depending on role as the implementation is RBAC .

thanks
govind

jhoojharsinghyadav replied on Thursday, August 30, 2007

Joe /Rocky,

   I tried using the membership provider of Microsoft with sqlserver i.e sqlmembership provider and thus its real real untidy work i would end up saying .

these are wholly my views ,

 i am not able to understand why microsoft guys had created up so much of complexity with these simple providers , they had entirely hard coded the membership methods say for creatuser(string name ,.....) rather then it it should go up with a fully customisable format i.e my view is that instead of taking these parameters hard coded , why hadnt they considered of making a class of userinfo which do contain all the properties for the user , membership and profiler (and could have use 1 table for membership and user and 1 for profile if required else its not to be required) and then passed that object to the createuser method .

this could have an great added advantage to the users like me looking for customisation of membership provider , what was required just to modify the userinfo class (add,delete properties , modify procedures for them ) and let the methods roll on as is .

is this kind of thing be achiveable ...?????

hugely stucked with customisation of membership providers .
 
request your valuable comments on the same
thanks
govind

jhoojharsinghyadav replied on Monday, September 03, 2007

please have a visit to http://forums.lhotka.net/forums/17224/ShowThread.aspx#17224

miloy001 replied on Tuesday, July 31, 2007

When I tried to open VB solution in VS2005 (without sp1), it says the project is created in a newer version and can not be opened. Do I need VS2005 + SP1 or VS2008 Beta?

Thanks,

 

RockfordLhotka replied on Tuesday, July 31, 2007

The cslacs and cslavb solutions both open in VS 2005 SP1. I wouldn’t think Microsoft changed the sln file format just for a service pack, but I suppose that is possible. You can probably just edit the sln file in notepad and back the version number by one if that’s the case (but I really doubt that’s the case).

 

Some of the _projects_ under the ProjectTracker folder are VS 2008 projects – the readme.txt at the top level describes which ones. Those projects are _not_ in the ProjectTracker solution. The ProjectTracker solution is a VS 2005 SP1 solution, and only includes VS 2005 projects.

 

Rocky

Copyright (c) Marimer LLC