in

Community

Take part in the community surrounding CodeBreeze and other products from SteelBlue Solutions.
Latest post 11-21-2008 8:26 PM by miguel. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-29-2008 8:18 AM

    Target Tags at Field Level

    We have now bought CodeBreeze after the evaluation period expired, and I need to know something.

    Is it envisaged to add functionality to allow for target tags (or something like target tags) to be applied at Field level (as opposed to Entity level).  I'd like to add additional information about the fields that make up my entities, and have the code generate differently based on this information.  Eg, in the default implementation (using CSLA) you get a Get[Entity] method generated on the collection class, which returns from the database a collection of all records.  I'd like to be able to amend the template to create a Get[Entity]by[FieldName] method for every field in the entity that has a certain "target tag".

    Please advise if something like this will be in v1.1 or soon thereafter.

  • 11-03-2008 1:03 PM In reply to

    Re: Target Tags at Field Level

    Any word on this yet?  Please advise asap, as I want to kick myself for not picking up on this one while evaluating CodeBreeze.  We have bought it now, but this is the one feature that is causing us to still use our inhouse-developed code generator, and I'd really like to make the switch to CodeBreeze.

  • 11-21-2008 3:44 PM In reply to

    Re: Target Tags at Field Level

    I know I've already emailed you, but I'll go ahead and post this. 

    public static List<string> GetListFilteredByTargetTagCommaDelimitedString(CodeBreeze.Business.BusinessEntity entity, string targetTagKey)
        {
            string commaDelimitedString = entity.Tags[targetTagKey].Value;
            string[] array = commaDelimitedString.Split(',');
            List<string> getObjectByFieldList = new List<string>(array);

            return getObjectByFieldList;
        }

    I have a target tag called GetObjectByField so I want to be able to generate mutliple values selecting that object back so I delimit it with a comma.  I just return a list of strings that I handle in the code template.  I pass in the entity and the target tag.

    In the code template, you would point to your template helper class and you would do this:

    List<string> objectListByField = GetListFilteredByTargetTagCommaDelimitedString(entity, "GetObjectByField");

    From here just loop through this and handle it in your template.  Granted you can handle this different ways, here is an example.

    Hope this helps.

  • 11-21-2008 8:26 PM In reply to

    Re: Target Tags at Field Level

    That's a good approach Joseph.  Target tags are limited to Entities/Wrappers only and only one value so you need to come up with your own parser for multiple values and you're on the right track there.

    I'm not sure if multiple tag values is going in any time soon as it's a little lower on the priority list.  One of the "high" items is to place a plug-in point into the target-tag subsystem so that you can auto-create them using a source of your choice (perhaps a foreign key list or something).  This one is not coming out in 2.0 but it will be out in a subsequent release.

    Thanks again for your support on these forums,

    Miguel A. Castro
    CodeBreeze Chief Architect - SteelBlue Solutions

Page 1 of 1 (4 items)
2008 - All rights reserved
Powered by Community Server (Commercial Edition), by Telligent Systems