Wrapping a pattern

Hi,
I've only just started the steep learning curve for Illustrator, so I'm very much still finding my way around the software.
That said, I'm stuck on something and quite frustrated that I can't move any further with it and so I was hoping someone from the forum could give a little advice.
I'm trying to recreate the look of a mosaic vase I have above my fireplace. I've created the vase shape using some ellipses. And I've created a pattern swatch that resembles the mosaic pattern on the vase itself.
But I can't for the life of me make either the vase 3D or wrap the pattern around it in a way that would look 3D.
It would be fantastic to have a little advice from some of the more expert users out there.
Thanks,
Audree

Thanks Jacob,
I'm working in CS4.
And I'm pleased that I've played around with the envelope functions and warp>bulge has produced exactly the sort of effect I was looking for.
Many thanks for your help,
Audree

Similar Messages

  • Seamlessly wrap a pattern around a 3D shape in Illustrator?

    Does anybody know how to seamlessly wrap a vector pattern around a 3D  rectangle in Illustrator?  I've tried doing it by taking sections of the  vector pattern and using the skew tool to adjust the perspective, but  it looks off.  Thanks!

    That's not a 3D box. It's a 2D oblique.
    If you want an actual 3D model, you can:
    1. Draw three rectangles proportional to the 3 visible sides of the box. Fill them with the pattern. Store each as a Symbol.
    2. Draw a filled, unstroked rectangle the size of one of the visible sides. Use Effect>3D>Extrude&Bevel to extrude it to a proportional depth.
    3. Use the Map Artwork feature in the 3D Effect dialog to map the Symbols to the visible sides.
    If you want to know a simple way to construct a properly proportioned 2D axonometric box, this PDF might help.
    JET

  • Using ExtensibleEnvironment and Command Pattern with 3.7.1 Release

    I am trying to port my project 3.6 project to 3.7.1. I am using the Extensible environment from the jar coherence-3.6-common-1.7.3.20019.jar
    While starting the cluster I am getting the below errors.
    Is there a confguration showing how to configure the Command Pattern and Extensible environment with XSD validation in 3.7.1?
    Exception in thread "main" (Wrapped: Failed to load the factory) (Wrapped: Missi
    ng or inaccessible constructor "com.oracle.coherence.environment.extensible.Exte
    nsibleEnvironment(String)"
    <configurable-cache-factory-config>
    <class-name>com.oracle.coherence.environment.extensible.ExtensibleEnvironment<
    /class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>C:/work/development/workspace/java/Coherence-Rest/cfg/cache-s
    erver-config.xml</param-value>
    </init-param>
    </init-params>
    </configurable-cache-factory-config>) java.lang.reflect.InvocationTargetExceptio
    n
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.net.ScopedCacheFactoryBuilder.getDefaultFactory(ScopedCa
    cheFactoryBuilder.java:311)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getSingletonFactory(Defau
    ltCacheFactoryBuilder.java:48)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getFactory(DefaultCacheFa
    ctoryBuilder.java:121)
    at com.tangosol.net.ScopedCacheFactoryBuilder.getConfigurableCacheFactor
    y(ScopedCacheFactoryBuilder.java:112)
    at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactor
    y.java:126)
    at com.tangosol.net.DefaultCacheServer.getDefaultConfigurableCacheFactor
    y(DefaultCacheServer.java:364)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: Missing or inaccessible constructor "com.oracle.coherence.e
    nvironment.extensible.ExtensibleEnvironment(String)"
    <configurable-cache-factory-config>
    <class-name>com.oracle.coherence.environment.extensible.ExtensibleEnvironment<
    /class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>C:/work/development/workspace/java/Coherence-Rest/cfg/cache-s
    erver-config.xml</param-value>
    </init-param>
    </init-params>
    </configurable-cache-factory-config>) java.lang.reflect.InvocationTargetExceptio
    n
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2652)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2536)
    at com.tangosol.net.ScopedCacheFactoryBuilder.getDefaultFactory(ScopedCa
    cheFactoryBuilder.java:273)
    ... 6 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:694)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2611)
    ... 8 more
    Caused by: java.lang.RuntimeException: Can't create a NamespaceContentHandler as
    the URI scheme [http] in [http://www.w3.org/2001/XMLSchema-instance] is not sup
    ported
    at com.oracle.coherence.environment.extensible.DefaultConfigurationConte
    xt$Scope.establishNamespaceContentHandlerFor(DefaultConfigurationContext.java:62
    5)
    at com.oracle.coherence.environment.extensible.DefaultConfigurationConte
    xt.ensureNamespaceContentHandler(DefaultConfigurationContext.java:94)
    at com.oracle.coherence.environment.extensible.DefaultConfigurationConte
    xt.processElement(DefaultConfigurationContext.java:254)
    at com.oracle.coherence.environment.extensible.DefaultConfigurationConte
    xt.processDocument(DefaultConfigurationContext.java:204)
    at com.oracle.coherence.environment.extensible.ExtensibleEnvironment.set
    Config(ExtensibleEnvironment.java:438)
    at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfig
    urableCacheFactory.java:193)
    at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfig
    urableCacheFactory.java:179)
    at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfig
    urableCacheFactory.java:155)
    at com.oracle.coherence.environment.extensible.ExtensibleEnvironment.<in
    it>(ExtensibleEnvironment.java:154)
    ... 14 more

    Hi
    Is there a reason you are using the 3.6 version of the incubator with Coherence 3.7 and not the latest INC-10 version? I suspect the 3.6 Incubator does not support normal XML schemas.
    JK

  • Is there an example to use interface to replace if then else pattern in F#

    is there an example to use interface to replace if then else pattern in F#
    i want to make match pattern with only one rule to represent dynamic number of rules which is use 
    let rec fun1 m number fun2param =
        match m with
        | fun2param(a,b,number) -> ****rewrite terms ****
    let fun2param number =
        if number = 1 then
                 function.....
        elif number = 2 then
                function ....
    computing nightmare

    In general, you use a match
    let fun2param number =
    match number with
    | 1 -> function.....
    | 2 -> function ....
    in the same way as you would use a `switch` construct in 'C' in place of a repeated if/elif...elif/else
    Your request is somewhat vague, so I'm not sure whether you would benefit from wrapping that behind an active pattern.

  • How can I count patterns of multiple rows in a table

    I just can't wrap my head around a query I need to identify the unique set of patterns with a table...by patterns I mean the following...
    This is medical procedural data, wherein the first procedure code is followed by 0 or more procedures in a sequence for each case. I need to find out how many of each sequence of procedures exist in the table from all the cases...
    row_id caseid proc_code sequence
    1 1 A 1
    2 1 B 2
    3 2 C 1
    4 3 A 1
    5 3 B 2
    So in this example data set I would like an output like this (something similar that would produce the number of times A followed B...and so on)
    row_id proc_set count(*)
    1 A-B 2
    2 C 1
    If someone could at least point me in a direction, I'd appreciate it...thanks ron.

    Interesting variation, Solomon.Yes, but gives different results if there are more than two linked procedures:
    SQL> with t as (
      2             select 1 case_id,'A' proc_code,1 seq from dual union all
      3             select 1,'B',2 from dual union all
      4             select 1,'C',3 from dual union all
      5             select 2,'C',1 from dual union all
      6             select 3,'A',1 from dual union all
      7             select 3,'B',2 from dual
      8            )
      9  select  proc_set,
    10          count(*) cnt
    11    from  (
    12           select  case level
    13                     when 1 then proc_code
    14                     else connect_by_root(proc_code) || '-' || proc_cod
    15                   end proc_set
    16             from  t
    17             where connect_by_isleaf = 1
    18             start with seq = 1
    19             connect by case_id = prior case_id
    20                    and seq     = prior seq + 1
    21          )
    22    group by proc_set
    23  /
    PROC_SET                    CNT
    A-B                           1
    C                             1
    A-C                           1While we get
    SQL> with t as (
      2  select 1 row_id, 1 caseid, 'A' proc_code, 1 sequence from dual union
      3  select 2, 1, 'B', 2 from dual union
      4  select 4, 2, 'C', 1 from dual union
      5  select 3, 1, 'C', 3 from dual union
      6  select 5, 3, 'A', 1 from dual union
      7  select 6, 3, 'B', 2 from dual)
      8  select row_number() over (order by proc_set) row_id,  proc_set, count(0) from (
      9  select ltrim(sys_connect_by_path(proc_code,'-'),'-') proc_set
    10    from t
    11  where connect_by_isleaf=1
    12  connect by prior sequence+1 = sequence and prior caseid=caseid
    13  start with sequence=1)
    14  group by proc_set;
        ROW_ID PROC_SET               COUNT(0)
             1 A-B                           1
             2 A-B-C                         1
             3 C                             1Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • How do I make a repeat pattern in Photoshop CC?

    I am trying to make a seamless repeat pattern in photoshop. I used to be able to do this in older versions of Photoshop by adjusting the position of my artboard in Filter -> Other -> Offset.
    Now I can't seem to adjust the offset by adjusting the pixels according to the size of my artboard, but I have to choose a pixel number between -1182 and +1182 instead?
    For instance, if my artboard is 100px I used to be able to set it to 50px so the artboard shifts halfway to the right. Now I have to set it at (1182 : 4=) 295px to get my artboard to that same position.
    Plus, when I use 'wrap around' the objects in my artboard don't appear on the other side of the artboard as should be the case.
    What is going on? Does anyone know how I can easily make a repeat pattern in Illustrator now? Is there something like 'Pattern maker" for Photoshop cc,  like the one that used to be available for older versions of PS but is now disabled for Photoshop CC?
    Thanks a bunch! 

    https://www.google.com/search?sourceid=chrome-psyapi2&rlz=1C1CHFX_enUS546US546&ion=1&espv= 2&ie=UTF-8&q=photoshop%20tutor…

  • New(?) pattern looking for a good home

    Hi everyone, this is my second post to sun forums about this, I initially asked people for help with the decorator and strategy pattern on the general Java Programming forum not being aware that there was a specific section for design pattern related questions. Since then I refined my solution somewhat and was wondering if anyone here would take a look. Sorry about the length of my post, I know it's best to keep it brief but in this case it just seemed that a fully functional example was more important than keeping it short.
    So what I'd like to ask is whether any of you have seen this pattern before and if so, then what is it called. I'm also looking for some fresh eyes on this, this example I wrote seems to work but there are a lot of subtleties to the problem so any help figuring out if I went wrong anywhere is greatly appreciated. Please do tell me if you think this is an insane approach to the problem -- in short, might this pattern have a chance at finding a good home or should it be put down?
    The intent of the pattern I am giving below is to modify behavior of an object at runtime through composition. In effect, it is like strategy pattern, except that the effect is achieved by wrapping, and wrapping can be done multiple times so the effect is cumulative. Wrapper class is a subclass of the class whose instance is being wrapped, and the change of behavior is accomplished by overriding methods in the wrapper class. After wrapping, the object "mutates" and starts to behave as if it was an instance of the wrapper class.
    Here's the example:
    public class Test {
         public static void main(String[] args) {
              double[] data = { 1, 1, 1, 1 };
              ModifiableChannel ch1 = new ModifiableChannel();
              ch1.fill(data);
              // ch2 shifts ch1 down by 1
              ModifiableChannel ch2 = new DownShiftedChannel(ch1, 1);
              // ch3A shifts ch2 down by 1
              ModifiableChannel ch3A = new DownShiftedChannel(ch2, 1);
              // ch3B shifts ch2 up by 1, tests independence from ch3A
              ModifiableChannel ch3B = new UpShiftedChannel(ch2, 1);
              // ch4 shifts ch3A up by 1, data now looks same as ch2
              ModifiableChannel ch4 = new UpShiftedChannel(ch3A, 1);
              // print channels:
              System.out.println("ch1:");
              printChannel(ch1);
              System.out.println("ch2:");
              printChannel(ch2);
              System.out.println("ch3A:");
              printChannel(ch3A);
              System.out.println("ch3B:");
              printChannel(ch3B);
              System.out.println("ch4:");
              printChannel(ch4);
         public static void printChannel(Channel channel) {
              for(int i = 0; i < channel.size(); i++) {
                   System.out.println(channel.get(i) + "");
              // Note how channel's getAverage() method "sees"
              // the changes that each wrapper imposes on top
              // of the original object.
              System.out.println("avg=" + channel.getAverage());
    * A Channel is a simple container for data that can
    * find its average. Think audio channel or any other
    * kind of sampled data.
    public interface Channel {
         public void fill(double[] data);
         public double get(int i);
         public double getAverage();
         public int size();
    public class DefaultChannel implements Channel {
         private double[] data;
         public void fill(double[] data) {
              this.data = new double[data.length];
              for(int i = 0; i < data.length; i++)
                   this.data[i] = data;
         public double get(int i) {
              if(i < 0 || i >= data.length)
                   throw new IndexOutOfBoundsException("Incorrect index.");
              return data[i];
         public double getAverage() {
              if(data.length == 0) return 0;
              double average = this.get(0);
              for(int i = 1; i < data.length; i++) {
                   average = average * i / (i + 1) + this.get(i) / (i + 1);
              return average;
         public int size() {
              return data.length;
    public class ModifiableChannel extends DefaultChannel {
         protected ChannelModifier modifier;
         public void fill(double[] data) {
              if (modifier != null) {
                   modifier.fill(data);
              } else {
                   super.fill(data);
         public void _fill(double[] data) {
              super.fill(data);
         public double get(int i) {
              if(modifier != null)
                   return modifier.get(i);
              else
                   return super.get(i);
         public double _get(int i) {
              return super.get(i);
         public double getAverage() {
              if (modifier != null) {
                   return modifier.getAverage();
              } else {
                   return super.getAverage();
         public double _getAverage() {
              return super.getAverage();
    public class ChannelModifier extends ModifiableChannel {
         protected ModifiableChannel delegate;
         protected ModifiableChannel root;
         protected ChannelModifier tmpModifier;
         protected boolean doSwap = true;
         private void pre() {
              if(doSwap) { // we only want to swap out modifiers once when the
                   // top call in the chain is made, after that we want to
                   // proceed without it and finally restore doSwap to original
                   // state once ChannelModifier is reached.
                   tmpModifier = root.modifier;
                   root.modifier = this;
                   if(delegate instanceof ChannelModifier)
                        ((ChannelModifier)delegate).doSwap = false;
         private void post() {
              if (doSwap) {
                   root.modifier = tmpModifier;
              } else {
                   if(delegate instanceof ChannelModifier)
                             ((ChannelModifier)delegate).doSwap = true;
         public ChannelModifier(ModifiableChannel delegate) {
              if(delegate instanceof ChannelModifier)
                   this.root = ((ChannelModifier)delegate).root;
              else
                   this.root = delegate;
              this.delegate = delegate;
         public void fill(double[] data) {
              pre();
              if(delegate instanceof ChannelModifier)
                   delegate.fill(data);
              else
                   delegate._fill(data);
              post();
         public double get(int i) {
              pre();
              double result;
              if(delegate instanceof ChannelModifier)
                   result = delegate.get(i);
              else
                   result = delegate._get(i);
              post();
              return result;
         public double getAverage() {
              pre();
              double result;
              if(delegate instanceof ChannelModifier)
                   result = delegate.getAverage();
              else
                   result = delegate._getAverage();
              post();
              return result;
         public int size() {
              //for simplicity no support for modifying size()
              return delegate.size();
    public class DownShiftedChannel extends ChannelModifier {
         private double shift;
         public DownShiftedChannel(ModifiableChannel channel, final double shift) {
              super(channel);
              this.shift = shift;
         @Override
         public double get(int i) {
              return super.get(i) - shift;
    public class UpShiftedChannel extends ChannelModifier {
         private double shift;
         public UpShiftedChannel(ModifiableChannel channel, final double shift) {
              super(channel);
              this.shift = shift;
         @Override
         public double get(int i) {
              return super.get(i) + shift;
    Output:ch1:
    1.0
    1.0
    1.0
    1.0
    avg=1.0
    ch2:
    0.0
    0.0
    0.0
    0.0
    avg=0.0
    ch3A:
    -1.0
    -1.0
    -1.0
    -1.0
    avg=-1.0
    ch3B:
    1.0
    1.0
    1.0
    1.0
    avg=1.0
    ch4:
    0.0
    0.0
    0.0
    0.0
    avg=0.0

    jduprez wrote:
    Hello,
    unless you sell your design better, I deem it is an inferior derivation of the Adapter pattern.
    In the Adapter pattern, the adaptee doesn't have to be designed to support adaptation, and the instance doesn't even know at runtime whether it is adapted.
    Your design makes the "modifiable" class aware of the modification, and it needs to be explicitly designed to be modifiable (in particular this constrains the implementation hierarchy). Overall DesignPattern are meant to provide flexibility, your version offers less flexibility than Adapter, as it poses more constraint on the modifiable class.
    Another sign of this inflexibility is your instanceof checks.
    On an unrelated note, I intensely dislike your naming choice of fill() vs _fill()+, I prefer more explicit names (I cannot provide you one as I didn't understand the purpose of this dual method, which a good name would have avoided, by the way).
    That being said, I haven't followed your original problem, so I am not aware of the constraints that led you to this design.
    Best regards,
    J.
    Edited by: jduprez on Mar 22, 2010 10:56 PMThank you for your input, I will try to explain my design better. First of all, as I understand it the Adapter pattern is meant to translate one interface into another. This is not at all what I am trying to do here, I am trying to keep the same interface but modify behavior of objects through composition. I started thinking about how to do this when I was trying to apply the Decorator pattern to filter some data. The way I would do that in my example here is to write an AbstractChannelDecorator that delegates all methods to the Channel it wraps:
    public abstract class AbstractChannelDecorator implements Channel {
            protected Channel delegate;
    ...// code ommitted
         public double getAverage() {
              return delegate.getAverage();
    ...// code ommitted
    }and then to filter the data I would extend it with concrete classes and override the appropriate methods like so:
    public class DownShiftedChannel extends AbstractChannelDecorator {
         ...// code ommitted
         public double get(int i) {
              return super.get(i) - shift;
           ...// code ommitted
    }(I am just shifting the data here to simplify the examples but a more realistic example would be something like a moving average filter to smooth the data).
    Unfortunately this doesn't get me what I want, because getAverage() method doesn't use the filtered data unless I override it in the concrete decorator, but that means I will have to re-implement the whole algorithm. So that's pretty much my motivation for this, how do I use what on the surface looks like a Decorator pattern, but in reality works more like inheritance?
    Now as to the other points of critique you mentioned:
    I understand your dislike for such method names, I'm sorry about that, I had to come up with some way for the ChannelModifier to call ModifiableChannel's super's method equivalents. I needed some way to have the innermost wrapped object to initiate a call to the topmost ChannelModifier, but only do it once -- that was one way to do it. I suppose I could have done it with a flag and another if/else statement in each of the methods, or if you prefer, the naming convention could have been fill() and super_fill(), get() and super_get(), I didn't really think that it was that important. Anyway, those methods are not meant to be used by any other class except ChannelModifier so I probably should have made them protected.
    The instanceof checks are necessary because at some point ChannelModifier instance runs into a delegate that isn't a ChannelModifier and I have to somehow detect that, because otherwise instead of calling get() I'd call get() which in ModifiableChannel would take me back up to the topmost wrapper and start the whole call chain again, so we'd be in infinite recursion. But calling get() allows me to prevent that and go straight to the original method of the innermost wrapped object.
    I completely agree with you that the example I presented has limited flexibility in supporting multiple implementations. If I had two different Channel implementations I would need two ModifiableChannel classes, two ChannelModifiers, and two sets of concrete implementations -- obviously that's not good. Not to worry though, I found a way around that. Here's what I came up with, it's a modification of my original example with DefaultChannel replaced by ChannelImplementation1,2:
    public class ChannelImplementation1 implements Channel { ... }
    public class ChannelImplementation2 implements Channel { ... }
    // this interface allows implementations to be interchangeable in ChannelModifier
    public interface ModifiableChannel {
         public double super_get(int i);
         public double super_getAverage();
         public void setModifier(ChannelModifier modifier);
         public ChannelModifier getModifier();
    public class ModifiableChannelImplementation1
              extends ChannelImplementation1
              implements ModifiableChannel {
         ... // see DefaultChannel in my original example
    public class ModifiableChannelImplementation2
              extends ChannelImplementation1
              implements ModifiableChannel { ...}
    // ChannelModifier is a Channel, but more importantly, it takes a Channel,
    // not any specific implementation of it, so in effect the user has complete
    // flexibility as to what implementation to use.
    public class ChannelModifier implements Channel {
         protected Channel delegate;
         protected Channel root;
         protected ChannelModifier tmpModifier;
         protected boolean doSwap = true;
         public ChannelModifier(Channel delegate) {
              if(delegate instanceof ChannelModifier)
                   this.root = ((ChannelModifier)delegate).root;
              else
                   this.root = delegate;
              this.delegate = delegate;
         private void pre() {
              if(doSwap) {
                   if(root instanceof ModifiableChannel) {
                        ModifiableChannel root = (ModifiableChannel)this.root;
                        tmpModifier = root.getModifier();
                        root.setModifier(this);
                   if(delegate instanceof ChannelModifier)
                        ((ChannelModifier)delegate).doSwap = false;
         private void post() {
              if (doSwap) {
                   if(root instanceof ModifiableChannel) {
                        ModifiableChannel root = (ModifiableChannel)this.root;
                        root.setModifier(tmpModifier);
              } else {
                   if(delegate instanceof ChannelModifier)
                             ((ChannelModifier)delegate).doSwap = true;
         public void fill(double[] data) {
              delegate.fill(data);
         public double get(int i) {
              pre();
              double result;
              if(delegate instanceof ModifiableChannel)
    // I've changed the naming convention from _get() to super_get(), I think that may help show the intent of the call
                   result = ((ModifiableChannel)delegate).super_get(i);
              else
                   result = delegate.get(i);               
              post();
              return result;
         public double getAverage() {
              pre();
              double result;
              if(delegate instanceof ModifiableChannel)
                   result = ((ModifiableChannel)delegate).super_getAverage();
              else
                   result = delegate.getAverage();
              post();
              return result;
         public int size() {
              return delegate.size();
    public class UpShiftedChannel extends ChannelModifier { ...}
    public class DownShiftedChannel extends ChannelModifier { ... }

  • Feedback on use of incubator command pattern

    Hi,
    We are currently prototyping some different solutions using coherence incubator (namely command pattern) and are looking for some feedback as to the viability and potential improvements to the solution.
    h3. Summary of Prototype
    The prototype does the following (i have a nice sequence diagram for this but don't see a way to attach it :():
    + client (e.g. through coherence extend) calls local api to save a "message" for a particular account (e.g. Account id = 1234). This calls namedcache.put and inserts an entry into the cache.
    + BackingMapListener is configured for the cache into which the client indirectly inserts. In the prototype this is a spring bean that extends AbstractMultiplexingBackingMapListener - which is fully "loaded" with all the required dependencies for the processing of the message (services, etc.).
    + The listener then registers a new context (using ContextManager) using a "grouping" id based on the sequence/ordering requirements. For example, say that each message against an account needs to be processed in order. The context would get instantiated with name = "1234", so that subsequent requests for account 1234 will get queued against the context with the same name whilst the previous request(s) are still processing. Messages for other accounts would register a different context name so they will get simultaneously processed.
    NB: The functionality of this listener can be paralleled to the sample in CommandPatternExample for one submission. I am not entirely clear where command submissions typically "tie-in" but I am planning to kick them off from a backingmaplistener. I briefly explored using the 'com.oracle.coherence.common.events.dispatching.listeners.DelegatingBackingMapListener' to dispatch the commands but not entirely how this would tie in. As I understand it the delegating backingmaplistener is used within the 'liveobjects' context and dispatches entries that implement the LifecycleAwareEntry but not sure how we would create "custom-contexts" as we require (i.e. the identifier is not for the key of the cache entry but rather a subset of that -e.g. account id versus account message id).
    + A command is then created to process the account message, which is comprised of
    - the Account which needs processed (the value of the backing map listener contains the Account itself)
    - Any components that are required during processing (services, daos, etc - service might itself be injected with daos, etc.)
    + The newly instantiated command is then then submitted to the CommandSubmitter for the appropriate contextIdentifer (the one returned by 1234 in our example).
    From some basic tests, the prototype is behaving as I desire - i.e. it queues and "synchronizes" the commands for the same context and also simultaneously processes commands assigned to different contexts asynchronously. That's great.
    However, there are a number of things I am exploring for the actual implementation. I believe most of these are typical concerns so I wonder if Oracle or anyone can provide some feedback from past experience/proposed recommendations:
    h3. Questions
    h4. 1. Grid/server-side Business Logic Deployment
    One of the things that has occurred to us is that ideally we would like to store the business processing logic (i.e. the heart of the processing within the command) either inside the grid or within a coherence node (i.e. made available through the classpath of the node startup).
    In our case we have a few different "processing models", but ideally the processor/command will simply determine the appropriate control flow (i.e. within the command - or maybe the appropriate lifecycle if we end up using that) and associated business logic off the attributes of the object to be processed. I am not sure if our use case is typical, but to be clear we have a fair bit of business logic to be performed within the 'command', each in separate modules. In implementation, most modules will be interacting with the grid for lookups, etc. but ideally that will be abstracted from the Processor/Command which will only know that it is using an 'accountService' - for e.g.
    Currently the business logic is "loaded" into the listener and "passed on" to the command through composition. Ideally we ant the command would be light-weight and the various "processing models" would either:
    a) be deployed to each node and somehow "available" to the command during execution. Would need to work out how this would be come available to the execution environment; perhaps each 'Context' would wrap the processing details. However, even this is a bit too granular as likely a processing model will apply to many contexts.
    b) Perhaps the business logic/processing components are deployed to the cache itself. Then within the command attributes on the object would be consulted to determine which processing model to "apply" and a simple lookup could return the appropriate control flow/processor(s).
    c) Perhpaps the different logic/flow is embedded in a different "lifecycle" for the event processing and the appropriate lifecycle is detected by the listener and appropirately applied. Even with such a model we'd still like the various processing for each phase to be maintained in the server if possible.
    Has anyone else done something like this and/or are there any thoughts about deploying the business logic to the grid this way? I see advantages/disadvantages with the different solutions, and some of them seem better for upgrades. For example if you upgrade the processing logic whilst requests are still coming in (clearly you would attempt to avoid this) and it is embedded into each node, what would happen if one node has been upgraded and a request comes to that node. Say one of the business logic modules performs a query against the cache which needs to consult another node (e.g. assuming you're using partitioned data) and that node has not received the upgrade and there's a conflict. In that regard perhaps deploying the different processing logic to a replicated cache makes more sense because once updated it should get pushed immediately to all nodes?
    Are these known concerns? I'm new to grid-side processing concepts so just correct me if there's an obvious issue with tis.
    h4. 2. Cleanup/Management of contexts
    One thing I noticed on my prototype is that the context's that I create don't really go away. We are envisioning creating Many context per day (let's just say a few hundred million to be safe)
    so ...
    a) how do people normally remove the contexts? Does the command framework sort this out behind the scenes? I can see the 'stop' method on the CommandExecutor removing the context, but from a quick follow-through the only scenario which seems to potentially call this is if the context version number has changed. Is there some way to change the version when we submit additional commands to the same context?
    b) Is there an issue with creating this many Contexts? As per earlier mention, to reduce overhead ideally the context will not be too heavy but any thoughts on our intended usage? We could use something like a hashing scheme to "bucket" the requests to contexts to reduce the total number of Contexts if required but this is not ideal.
    h4. 3. Creation of new Command Every time.
    In our scenario, each command needs to act upon a given object (e.g. one account). As I see it, this requires us to create a new Command for each message, because I do not see a way to 'pass in' the object to the execute method. Setting it to the context does not work either because we need to queue a few requests to each given context; I played with wrapping the object with GenericContext and setting the value but in reality we're submitting the commands whilst others are currently being processed so I don't see how this could work.
    Any thoughts on this? Do you agree we'll have to create a new command for every message to be processed? We'll likely have millions of Commands per day so this will make a difference for us (although if we eliminate the logic from q#1 or the dependencies are singletons it's not a big deal)
    h4. 4. Concurrency guarantees with the commandpattern
    I also want to confirm my understanding of concurrency controls around the command pattern. Unlike an entry processor which controls updates to the entry upon which it was invoked, the command pattern only guarantees concurrency against processing occuring within the context of the currently operating command. Commands submitted to the same context will be processed synchronously but any entries which may have had a listener which spawned the command submission are in no way guarded. This latter point is pretty obvious I believe since there's no real link but I just want to make sure my assumptions are correct.
    NB: in the scenario I am describing we do NOT need to update the original cache entry into which the account message was submitted. Instead other caches will be updated with results from additional processing logic so this is not that much of an issue for us.
    h4. 5. Confirmation of concerns with "straight" entry processor
    If we were to use a "straight" entry processor (versus command pattern which uses entry processor) which gets kicked off from a threadpool on a backing map listener (for example on insert or update), is it true that if a node were to go down, we would have issues with failover? NB: The reason we would kick off the entry processor from a threadpool would be to "simulate" asynchronous processing. As I see it, if we kicked off a thread on the listener and returned back to the client, nothing would "re-submit" the request if a node goes down. Is that correct?
    ALTERNATIVELY, As I understand it, with an entry processor invoked from a client, it is the client coherence jar that receives the exception when a node goes down mid-process and the coherence jar takes care of "re-sending" the request to another node. So - if the threadpool is managed by the client and the client kicks off an invoke in one of the threads - then I believe the client WILL re-submit the entry processor requests if the node goes down - through the coherence jar/extend - not sure on the details but my point is that the client application does not have to provide any code for the "failover" but the coherence client jar performs this.
    h4. 6. Lifecycle
    I have not explored the "lifecycle" functionality available within the incubator - but as I understand it the main thing it could offer is that if we have many phases of the processing (as we do in most our use cases) - that the processing can be managed with the different lifecycles. NB: To be clear I am referring to 'live objects' with their own series of processing steps - not 100% if Lifecycle directly relates to 'live objects'. If a node goes down and is in the midst of processing 200,000 commands - the entire processing doesn't need to start over.. each request will need to go back to the previous completed phase of the lifecycle but may well avoid duplicated processing. All processing will need to be idempotent regardless, but lifecycles could avoid re-processing that was already complete.
    Is this correct?
    Other benefits?
    (e.g. configurable processing logic as alluded to in Q#1).
    Thanks very much
    Edited by: 822486 on 21-Dec-2010 16:23
    Edited by: 822486 on 21-Dec-2010 16:59

    Hi User 822486,
    When delving into a detailed prototype like the one you have below it's often useful to understand the use cases and business requirements before jumping into a solution. I think it may be best for you to reach out to the Coherence organization within oracle to further discuss these questions in detail so we can better guide you in the different ways to solve problems with Coherence and the incubator. I'll do my best to comment on your prototype and address the questions that you currently have:
    NB: The functionality of this listener can be paralleled to the sample in CommandPatternExample for one submission. I am not entirely clear where command submissions typically "tie-in" but I am planning to kick them off from a backingmaplistener. I briefly explored using the 'com.oracle.coherence.common.events.dispatching.listeners.DelegatingBackingMapListener' to dispatch the commands but not entirely how this would tie in. As I understand it the delegating backingmaplistener is used within the 'liveobjects' context and dispatches entries that implement the LifecycleAwareEntry but not sure how we would create "custom-contexts" as we require (i.e. the identifier is not for the key of the cache entry but rather a subset of that -e.g. account id versus account message id).
    Command submissions are just that, submissions to the command pattern for execution and they can be triggered from anywhere since they run asynchronously. The DelegatingBackingMapListener and the associated eventing model provides you with the foundations for building an Event Driven Architecture on top of coherence. It's used by both the Push Replication Pattern as well as the Messaging Pattern which you could use as references if you wanted to go down the path of using the eventing model as well. It really comes down to your use case (which I don't have a lot of details on at the moment). An Entry that is a LifecycleAwareEntry can basically take action when it's state is changed (an event occurs). As a completely bogus example you could have a AccountMessageDispatcher object in a cache with a DelegatingBackingMapListener configured and you could submit EntryProcessors to this dispatcher that gives it a set of messages to perform for a set of accounts. The Dispatcher could then every time it's updated submit commands for execution. In essence it's formalizing an approach to responding to events on entries - or server side event driven programming.
    h2. Grid/server-side business logic deployment
    Have you looked at the processing pattern at all? It's a framework for building compute grids on top of Coherence and may have more plumbing in place for you to achieve what you're looking for. I think it may be best for us to discuss your use case in more detail to understand the pros and cons of each approach before commenting further on a solution for you.
    h2. Cleanup and Management of contexts
    Contexts are marker interfaces so they can be incredibly lightweight which should allow you to create as many of them as you need. The biggest concern is ensuring that you have enough processing power in your grid to handle the volume of work you want to manage. This should be a simple matter of figuring out your load and sizing your cluster appropriately. The initial design of the command pattern was to have a set of well established contexts that would be used repeatedly. Given that the Command Pattern is primarily an example, you could extend the DefaultContextsManager to have an unregisterContext method.
    h2. Creation of new command every time
    I'm a little confused by your requirement here. Are you saying that you have a set of pre-defined operations that you want to apply to an account for example incrementAccountBalancyBy1? If so, I don't understand why you couldn't submit the same command instance to a context multiple times. While I wouldn't recommend using statics you could have a CommandFactory that returned the same command each time you call getCommand once it was instantiated once. Usually however we expect that you'll have some additional data unique to each message that the command must execute. This could be handled by having a setter on your command for these properties.
    h2. Concurrency Guarantees
    The Command Pattern Guaranteees that for a given context commands are processed synchronously in the order they are received. If you have multiple submitters sending commands to the same context, then the order of when the commands are processed will be based on the order in which they arrive at the node where the Context resides. A context is the control point that gives commands their ordering.
    h2. Confirmation of concerns with "straight" entry processor
    I'm not sure if I follow your question here. EntryProcessors are guaranteed to execute, even in the failure scenario (this is why they're backed up and why they must be idempotent). If you're referring to processing events based on a backing map listener rather than submitting commands, it handles your processing then it's a matter of wether you're asynchronously processing the events or not. If you are synchronously processing things and your node dies while the BML is executing you're right a node failure at that point will result in "nothing happening" and the client will re-try. If however you're asynchronously handling the events from your BML, then you could lose state. This is why we use entries the way we do in the common event layer, we persist state on an entry that we can't lose when a node fails. This allows us to asynchronously process the data after the node has been updated.
    h2. Lifecycle
    With respect to lifecycle if you're referring to LifeCycleAwareEntry - this is a way of designating that an Entry in the cache can process events when modified/mutated. This may be better discussed by phone or in person.

  • Finding text based files containing a keyword/pattern... filtering those that match pattern 2... etc.

    I'm looking to see if Powershell can help me solve a common issue I come across dealing with a large code base / set of files.
    In short I'm very frequently wanting to "grep" for files that contain a certain keyword or pattern... then (recursively) filter that set of files to those that (A) also include or (B) specifically do not include another keyword or pattern.
    e.g.
    Lets say that I have 300 PHP files that are all somewhere within a folder called "project_files".  I'd like to find all files that contain "someInclude.php"... and also contain "specialFunction()"
    Can I do this in one pass... e.g. pipe to pipe to pipe? or do I need to collect the list of file names in the first pass, then re-run the sub-query(/ies)
    $results = Get-ChildItem -recurse -ErrorAction SilentlyContinue | Select-String -pattern "someInclude.php"
    (wrapped code for readability)
    ...this is where I'm stuck as to where to go next...
    Can I iterate over my results? or do I need to write these to a file and read that file back in, searching in each file as I load it?

    Ideally I'd like to get an output at the end that is a result for each match with data including the file, the line number where the match was found, and even the line of text itself.
    I currently have this working for a single keyword search... outputting the final results object to a CSV file
    Get-ChildItem -recurse -ErrorAction SilentlyContinue |
    Select-String -pattern "someInclude.php" -AllMatches -CaseSensitive -ErrorAction SilentlyContinue |
    Select-Object path,linenumber,line |
    Export-Csv "c:\someFolder\MyMatches.csv"
    I wrapped the code above for readability... and in the Select-Object
    path = full file path
    linenumber = the line of the match
    line = the actual (full) line of text that was matched
    However in all honesty the format doesn't really matter... I just want to find the files that meet my criteria ;-)

  • Word Wrap In Excel File

    Hi experts,
    I am trying to send an excel file as attachment . I have a column called remarks which is way too long. So  i need to Wrap the text
    Can any one help me out in this?
    CONCATENATE DUMMY BUKRS WERKS  it_inv-bstnk_vf IT_INV-ORT01 VEHNO 'SUGAR' FKLMG BP EXCDUTY EXINVNO
    EXDAT NETVL IT_INV-NAM_1 IT_INV-KZABE IT_INV-KZGBE  INTO IT_ATTACH SEPARATED BY CON_TAB.
    CONCATENATE IT_ATTACH CL_ABAP_CHAR_UTILITIES=>CR_LF INTO IT_ATTACH."nam_1 has to be Word Wrapped
    APPEND IT_ATTACH.
    With thanks in Advance
    Syed Ibrahim .G

    thanks simone,
    I tried with converting to XML and then to excel.It is getting generated , but i cannot open the excel file.
    It is showing the error when i am trying to open the file in the log.
    XML PARSE ERROR:  Undefined namespace
    this is the code i am using.
      l_ixml = cl_ixml=>create( ).
    * Creating the DOM Object Model
      l_document = l_ixml->create_document( ).
    * Create Root Node 'Workbook'
      l_element_root  = l_document->create_simple_element( name = 'Workbook'  parent = l_document ).
      l_element_root->set_attribute( name = 'xmlns'  value = 'urn:schemas-microsoft-com:office:spreadsheet' ).
      call method l_element_root->set_attribute_node"( ns_attribute ).
      exporting
        NEW_ATTR = ns_attribute.
      r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT'  parent = l_element_root ).
      l_value = sy-uname.
      l_document->create_simple_element( name = 'Author'  value = l_value  parent = r_element_properties  ).
      r_styles = l_document->create_simple_element( name = 'Styles'  parent = l_element_root  ).
    call method r_style->set_attribute_ns
      exporting
         name = 'ID'
         prefix = 'ss'
         value = 'Header' .
      r_format  = l_document->create_simple_element( name = 'Font'  parent = r_style  ).
      r_format->set_attribute_ns( name = 'Bold'  prefix = 'ss'  value = '1' ).
      r_format  = l_document->create_simple_element( name = 'Interior' parent = r_style  ).
      r_format->set_attribute_ns( name = 'Color'   prefix = 'ss'  value = '#92D050' ).
      r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss'  value = 'Solid' ).
      r_format  = l_document->create_simple_element( name = 'Alignment'  parent = r_style  ).
      r_format->set_attribute_ns( name = 'Vertical'  prefix = 'ss'  value = 'Center' ).
      r_format->set_attribute_ns( name = 'WrapText'  prefix = 'ss'  value = '1' ).
      r_border  = l_document->create_simple_element( name = 'Borders'  parent = r_style ).
      r_format  = l_document->create_simple_element( name = 'Border'   parent = r_border  ).
      r_format->set_attribute_ns( name = 'Position'  prefix = 'ss'  value = 'Bottom' ).
      r_format->set_attribute_ns( name = 'LineStyle'  prefix = 'ss'  value = 'Continuous' ).
      r_format->set_attribute_ns( name = 'Weight'  prefix = 'ss'  value = '1' ).
      r_format  = l_document->create_simple_element( name = 'Border'   parent = r_border  ).
      r_format->set_attribute_ns( name = 'Position'  prefix = 'ss'  value = 'Left' ).
      r_format->set_attribute_ns( name = 'LineStyle'  prefix = 'ss'  value = 'Continuous' ).
      r_format->set_attribute_ns( name = 'Weight'  prefix = 'ss'  value = '1' ).
      r_format  = l_document->create_simple_element( name = 'Border'   parent = r_border  ).
      r_format->set_attribute_ns( name = 'Position'  prefix = 'ss'  value = 'Top' ).
      r_format->set_attribute_ns( name = 'LineStyle'  prefix = 'ss'  value = 'Continuous' ).
      r_format->set_attribute_ns( name = 'Weight'  prefix = 'ss'  value = '1' ).
      r_format  = l_document->create_simple_element( name = 'Border'   parent = r_border  ).
      r_format->set_attribute_ns( name = 'Position'  prefix = 'ss'  value = 'Right' ).
      r_format->set_attribute_ns( name = 'LineStyle'  prefix = 'ss'  value = 'Continuous' ).
      r_format->set_attribute_ns( name = 'Weight'  prefix = 'ss'  value = '1' ).
      r_worksheet = l_document->create_simple_element( name = 'Worksheet'  parent = l_element_root ).
      r_worksheet->set_attribute_ns( name = 'Name'  prefix = 'ss'  value = 'Sheet1' ).
      r_table = l_document->create_simple_element( name = 'Table'  parent = r_worksheet ).
      r_table->set_attribute_ns( name = 'FullColumns'  prefix = 'x'  value = '1' ).
      r_table->set_attribute_ns( name = 'FullRows'     prefix = 'x'  value = '1' ).
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).
      r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '40' ).
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).
      r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '90' ).
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).
      r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '140' ).
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).
      r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '150' ).
    With thanks in advance,
    Syed Ibrahim . G

  • url-pattern for extension mapping in security-constraint not working

    I'm trying to use extension mapping in a <security-constraint> configuration,
    According to:
    http://download.oracle.com/otn-pub/jcp/servlet-3_1-fr-eval-spec/servlet-3_1-final.pdf?AuthParam=1429824454_de04222eab1b8…
    Section 12.2:
    A string beginning with a ‘*.’ prefix is used as an extension mapping.
    But WebLogic does not take in consideration my configuration. If I use path mapping exact mapping it work.
    My configuration is:
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Unsecured</web-resource-name>
            <url-pattern>*.wsdl</url-pattern>
            <url-pattern>*.xsd</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>HttpAuth</web-resource-name>
            <url-pattern>/ws/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>ws-user</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>INTEGRAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Test1</realm-name>
    </login-config>
    <security-role>
        <role-name>ws-user</role-name>
    </security-role>
    WebLogic Server 12c (12.1.3)
    Has anybody used extension mapping with security-constraint? Is that a WebLogic issue?

    Hi nikita,
    I have delt with the same problem before. As you say, most JSF actions all get posted back to the original page, and the faces servlet internally redirects according to the navigation rules and actions. This can mean the URL seen by the browser does not always correspond to the actual JSP (wrapped by JSF) that produced the content.
    Generally adding the "<redirect/>" tag to all your navigation rules (in faces-config.xml) remedies this, so the actions are still posted back to the original page, but then the JSF servlet sends an http-redirect to the browser before invoking the new page. This way, the URL is always in sync, and the security constraints defined in your web descriptor always get invoked properly.
    regards,
    tony

  • DAO Pattern and the ServiceLocator

    I have been developing a lightweight framework for working with AIR and the SQL API. This framework has no dependencies on Cairngorm however it is built around a typical DAO implementation.
    While developing this I considered how it should be integrated with Cairngorm, which lead me to wonder if a simple DAO marker interface which could be retrieved from the ServiceLocator (and cast to the correct abstraction by a business delegate) would not be all that is needed to have a rather flexible service layer in Cairngorm?
    For example, consider the following pseudo code which is what I would imagine a business delegate to look like:
    class FooDelegate {
    protected fooDAO:IFooDAO;
    public FooDelegate(responder:IResponder) {
    fooDAO = ServiceLocator.getinstance().getDAO(Service.FOODAO) as IFooDAO;
    fooDAO.addResponder( responder );
    public getFoo() void {
    fooDAO.getFoo();
    public addFoo(foo:IFoo) {
    fooDAO.addFoo(foo);
    public deleteFoo(foo:IFoo) {
    fooDAO.deleteFoo(foo);
    As you can see the delegate would cast the dao to the correct abstraction and then just wrap the DAOs API (somewhat similar to an Assembler in LCDS).
    A custom DAO interface would extend the DAO marker interface so that the ServiceLocator could find it:
    interface IFooDAO extends IDAO
    getFoo() void;
    addFoo(foo:IFoo);
    deleteFoo(foo:IFoo);
    Service.mxml would define an instance of the dao as an abstraction and then call a factory to get the appropriate implementation:
    public fooDAO:IFooDAO = DAOFactory.getDAO("foo");
    I see much potential in this type of implementation as it would allow services to be swaped out with different implementations via a config or with an IoC implementation etc, thus allowing the services themselves to be completely transparent to client code.
    I wanted to see if anyone had any thoughts on this as well?
    Best,
    Eric

    Thanks, duffymo, that makes sense. However ... having read through numerous threads in which you voice your opinion of the DAO World According to Sun, I'd be interested to know your thoughts on the following ...
    Basically, I'm in the process of proposing an enterprise system architecture, which will use DAO as the primary persistence abstraction, and DAO + JPA in the particular case of persistence to a RDBMS. In doing so, I'd like to illustrate the various elements of the DAO pattern, a la the standard class diagram that relates BusinessObject / DataAccessObject / DataSource / TransferObject (http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html). With reference to this model, I know that you have a view on the concept of TransferObject (aka ValueObject?) - how would you depict the DAO pattern in its most generic form? Or is the concept of a generic DAO pattern compromised by the specific implementation that is used (in this case JPA)?

  • Best practices for JavaFX architecture and patterns?

    Hi,
    I want to write reusable, easy to maintain JavaFX code for a larger UI project and wonder what are the best practices doing so.
    1) Are there preferred UI patterns? MVC, MVP, Presentation Model, ...?
    2) Does it make sense to use FXML to separate View from Logic? Or should I use 2-3 Java classes instead (one for View, one for Logic, one for Domain Model, depending on the pattern)
    3) How to organize all the views? Should I use Dependency Injection? Or Singletons for each view? Spring or Guice framework, if at all?
    Currently I use singletons for most views, so that I can use them from anywhere in my application. If a window is closed and opened again, I use the same instance for that, which still resists in memory.
    For patterns, I try to lean on Presentation Model, since this is what I know from Flex development: Having a View layer, which contains all the UI stuff and an abstract view layer, which holds properties, that describe the View, e.g. submitButtonDisabledProperty. The View knows the abstract layer (Presentation Model), but not vice versa and the UI elements are bound to its properties.
    I am unsure if this is appropriate for JavaFX, too (for Flex or Silverlight it is).
    What are your recommendations / experiences for large UI projects?

    You are correct that in 'pure' MVP the View should know as little about it's presenter implementation as possible. The view should just notify one or more 'listeners' that something has happened.
    You can use event listeners for this, but I would highly recommend not exposing your Control-specific GUI events and instead create your own. So for example, don't expose ActionEvent or MouseEvent as these expose too much detail about your View's implementation, instead create 'semantic' events, so you might have something like 'sayHelloRequested' or 'printOptionSelected' (whatever naming system you want). This hides how the option is implemented, so you might have a 'print' button, a 'print' menu option, a CTRL+P print shortcut, or a double tap anywhere on your screen to print. The listener knows only that the view thinks 'print was requested by the user' - decoupling achieved.
    Once you start doing this however you end up with an explosion of event listener interfaces. So say a view has 10 callbacks it wants to notify about, then you end up with 10 interfaces, and if you're being really pure you also end up with 10 'Event' beans (or DTOs) to encapsulate the details of that event. It starts to get ungainly even for a semi-purist like me. So the logical progression from there is usually just to define all 10 callbacks in one interface and call it something like MyViewListener.
    There are two common ways to implement listeners, the traditional way is to allow an arbitrary number of listeners to be added. Whereas another option is to allow only a single listener to be added. In JFX you will notice that Button for example has a setOnAction() method not a addOnAction() method - it allows a single event handler only and let's face it this is generally fine in 95% of cases. For the remaining 5% you can just write your own aggregate event handler that dispatches the event to multiple listeners.
    So if we go down the road of single event listeners, using an interface for all of the callbacks and not bothering with full 'Event' objects, you end up with something like this:
    public interface MyViewListener {
        void printRequested();
        void doSomething(int someParam);   
        void doSomethingElse(String someOtherParam);   
    }And if you look closely at the 'Purist' option in my MVP pattern where I define interfaces for everything, then you will see that this is pretty much the exact interface I've created for the 'Presenter'. You could just as easily rename this interface to MyViewListener in this pattern and have the same outcome.
    So to wrap all that up, yes, the Presenter should be decoupled and I highly favour the 'purist' option in my blog and would definitely use it if FXML didn't dictate a impure design pattern (there are some ongoing discussions about this on the OpenJFX discussion group). And, yes, my 'purist' option could be even more pure if you went for the full-blown event callback model and if you go down that road you will have an extremely clean architecture but also an extremely large code-base - totally your call whether it's worth it.
    It's also worth remembering in all this, that there are a lot of people from a lot of different backgrounds using JFX and some people hate (passionately) even my semi-pure option - especially those coming from other, less heavy-weight languages. They just don't get why you wouldn't build it all into one class and reduce the overheads. So what you have in my blog is my thoughts on it, other people will most definitely differ. I'm a big fan of developer's choice, and that's why I did the smorgasboard approach even though I personally would never use some of those implementations.
    Also this video on GWT is an awesome reference on GUI design patterns: http://www.youtube.com/watch?v=PDuhR18-EdM
    JFX Flow draws a lot from GWT as I think it is a very clean architecture (just such a shame that they put all that effort into hiding the horrid, sordid mess that is the web+html+css, instead of making something proper, like JFX).
    Hope that helps,
    zonski

  • Wrapping a design around a 3D object

    Hello, I'm trying to figure out how to take the fish scale pattern that I have made (out of ovals) and transform it so that it not only fits the shape of the three sections of the outline, but also that the scales stay aligned with each other once the blue design is wrapped around a real (3D) object.
    I'm trying to make a decal to go around a model airplane.  This is what the real airplane looked like:
    I plan on hand painting the rest of the fish parts, but at 1/144 scale (about 25mm long) the fish scales are a little small to paint evenly!
    If anyone would like to play around with the actual .ai file, I've uploaded it to my server:
    www.wingsofwar.org/UserImages/FuselageWrap.ai
    Thank you for your time and help,
    Keith

    Here is a copy of your original file.
    JET

  • RE: design patterns involving EJBs and JDO

    Is the idea that you specify in some config file (xml?) the methods of
    your session bean, whether its stateful or stateless, the default bean
    transaction semantics, etc, then say "go" and it generates the home and
    remote interfaces and the skeletal session bean class?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:26 AM
    To: JDO-ListServ
    Subject: Re: design patterns involving EJBs and JDO
    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----
    From: Matthew <mailto:[email protected]> Adams
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated.
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric

    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----_
    From: Matthew <mailto:[email protected]> Adams_
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated._
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric_

Maybe you are looking for