composite

WPF databinding to composite class patterns?

I am trying out WPF for the first time and I am struggling with how to bind controls to a class that is built up using composition of other objects. For example, If I have class Comp that is built up of two separate classes (note various elements left out for clarity): class One { int _first; int _second; } class Two { string...

Map Composition in Fluent NHibernate

Hi, There are 2 classes: Product and Image. The Product has only one Image. No orphan Images can exist. This represent composition relationship in UML which means: Assigning Product.Image a newImage results in following delete old image; insert new image; link new image to the product. Now I need to map it to the RDBMS...

In CAB is a service it's own module?

I'm learning Composite Application Block and I've hit a rock about services. I have my shell application in its own solution, and of course a test module in its own solution (developed and testing completely independent and external of the shell solution). If I created a service named "Sql Service", would I need to put this in it's own l...

Nhibernate many-to-one Composite key - if null then fails? is many-to-one or none possible?

Hi Have the mapping as shown below. this is from a leagcy db so have no control over changing the structure. The File record in some circumstances will not have a link to the DISPLAY3 table. Every file has a link to the DISPLAY2 table. However if the File.DISPLAy3 field is null then is does not have a link to the DISPLAY3 only the DISPL...

Using the MVP for a composite structured object model.

(Edited a lot) I've got some classes with Abstracts Members. The concrete type of the abstract members is to be determined at the class instanciation, based on the user's input. However, the second member's concrete type might depend on the first member. I'm trying to do something keeping the MVP design pattern in mind. I taught about m...

In Prism (CAL), how can I RegisterPresenterWithRegion instead of RegisterViewWithRegion

I have a module in a Prism application and in its initialize method I want to register a presenter instead of a view with a region, i.e. I want to do this: PSEUDO-CODE: regionManager.RegisterPresenterWithRegion( "MainRegion", typeof(Presenters.EditCustomerPresenter)); instead of loading a view like this: regionManager.RegisterV...

Composite primary key: to use or not to use

I am working on the design of a database that will be used to store data that originates from a number of different sources. The instances I am storing are assigned unique IDs by the original sources. Each instance I store should contain information about the source it came from, along with the ID it was associated by this source. As an...

How do I associate a keypress with a DelegateCommand in Composite WPF?

I am building a composite application using CAL/Prism. The main region is a tab control, with multiple types of views in it. Each view has a custom set commands that it can handle which are bound to toolbar buttons at the top of the window. I've done this before in non-CAL apps by simply setting the InputBinding on the command, but I hav...

django - Showing multiple child forms inside parent

I have been studying the modalforms & inline formsets but am not able to wrap my head around my composite objects, and want to see how things are done in django world - I have this hierarchical model "Author" has many "Books" Each "Book" has 4 Sections -> Section-01, Section-02, Section-03 & Section-04 Each "Section" has number of...

python multiprocessing proxy

I have a 2 processes: the first process is manager.py starts in backgroung: from multiprocessing.managers import SyncManager, BaseProxy from CompositeDict import * class CompositeDictProxy(BaseProxy): _exposed_ = ('addChild', 'setName') def addChild(self, child): return self._callmethod('addChild', [child]) def ...

Best way to merge hex strings in c++? [heavily edited]

I have two hex strings, accompanied by masks, that I would like to merge into a single string value/mask pair. The strings may have bytes that overlap but after applying masks, no overlapping bits should contradict what the value of that bit must be, i.e. value1 = 0x0A mask1 = 0xFE and value2 = 0x0B, mask2 = 0x0F basically says that the...

ASP.NET: JavaScript object Component for Composite Control

Hi! I have two doubts: 1. I would like to add some client side support for my server composite control but I can't find the correct way to add JavaScript to him. 2. Another feature I would like to have for the client-side support is to have my JavaScript component object returned through $find(id, parent) (shortcut to findComponent me...

Difference between a WebControl and a CompositeControl?

Hello! I have been looking around on the web and found some articles about the topic, but i still can't figure out the difference between them. I have the code show below, if i inherit from a CompositeControl it works perfectly but not if i inherit from a WebControl. (They both render the code, but only the CompositeControl handles the ...

Is the Composite Pattern SOLID?

the leaf in the composite implements the Component that has the Add Remove and GetChild methods that he is never going to use (violation of the Interface segregation) so is the usage of composite pattern SOLID ? link to composite http://www.dofactory.com/Patterns/PatternComposite.aspx ...

Composite Application Framework Equivalent in Java

Just wondering what the opposing framework in Java would be for creating modular GUI applications, with things like event aggregation, etc. I know for Java there isn't a single definitive GUI framework, and so far I've seen the Eclipse RCP and Netbeans Platform, however these don't seem to do these kind of things. I'm a .Net developer ...

ASP.NET Custom Server Control Build -- Validator

I am writing a DateValidator control to function as a validator of all type for dates. It will function as an Required validator, a Min/Max validator, and a Range Validator for date comparisons on the client side. All in all, I have it written and it functions: In an ASPX page. For some reason, when adding it into an ASCX User Contro...

CompositeScriptRefernce

Hi, I'm trying to add a composite scriptreference like this; ScriptReference scriptReference = new ScriptReference("CSSFriendly.JavaScript.MenuAdapter.js", "CSSFriendly"); scriptReference.NotifyScriptLoaded = false; scriptManager.CompositeScript.Scripts.Add(scriptReference); In the CSSFriendly assembly the script resource is defined; ...

Database: When should I use a composite index?

When should I use a composite index in a database? What are the performance ramification by using a composite index)? Why should I use use a composite index? For example, I have a homes table: CREATE TABLE IF NOT EXISTS `homes` ( `home_id` int(10) unsigned NOT NULL auto_increment, `sqft` smallint(5) unsigned NOT NULL, `year_bui...

How to create Composite Key and how to refer it in other table as a foreign key

I have a table following table create table tblcountry ( unqid uniqueidentifier name varchar(100) isremoved bit ) I want to create primary key on basis of unqid + isremoved and in which isremoved must be true i have got another table: create table tblstate ( unqid uniqueidentifier, name varchar(100) f_tblcountry uniquei...

divert asp.net child controls

Hi Folks, I am trying to create an asp.net custom control that acts as a hosting container for any other controls, similar to the existing ‘Panel’ control. Basically, I need to build a web control that groups a bunch of other controls. It will consist of a header and a body pane, similar to a normal window in desktop application. The hea...